rjeschke / txtmark

Yet another markdown processor for the JVM
Apache License 2.0
449 stars 100 forks source link

conditional statement disappear #51

Open debarshri opened 8 years ago

debarshri commented 8 years ago

So I have this statement

~ ~ ~ ~ ~
if (a > 3) {
  moveShip(5 * gravity, DOWN);
}

What I get is for Processor.process(..)
is
a > 3) {
veShip(5 * gravity, DOWN);


Which is not the desired result.
rjeschke commented 8 years ago

I can not verify this issue by the example you give:

public static void main(final String[] args)
{
    final String markdown = "~ ~ ~ ~ ~\n" +
            "if (a > 3) {\n" +
            "  moveShip(5 * gravity, DOWN);\n" +
            "}\n";
    final Configuration conf = Configuration.builder().forceExtentedProfile().build();
    final String result = Processor.process(markdown, conf);
    System.out.println(result);
}

outputs:

<pre><code>if (a &gt; 3) {
  moveShip(5 * gravity, DOWN);
}
</code></pre>

which is exactly what I expected, even though the code block isn't closed here (the closing fence is missing).

debarshri commented 8 years ago

Ah. I was not using any configuration.

I used

Processor.process(markdown)