txtmark/README.md
2011-04-15 15:25:10 +02:00

5.4 KiB

txtmark - Java markdown processor

Copyright (C) 2011 René Jeschke rene_jeschke@yahoo.de See LICENSE.txt for licensing information.


txtmark is yet another markdown processor for the JVM.
... and is damn fast^^

Again this is a WIP release.

TODO:

  • block-level HTML element processing
  • code clean-ups
  • see below (markdown test suite)

MarkdownTest results so far


Based on MarkdownTest_1.0_2007-05-09

  • Amps and angle encoding ... OK
  • Auto links ... OK
  • Backslash escapes ... OK
  • Blockquotes with code blocks ... OK
  • Code Blocks ... OK
  • Code Spans ... OK
  • Hard-wrapped paragraphs with list-like lines ... OK
  • Horizontal rules ... OK
  • Images ... FAILED (see Note 1)
  • Inline HTML (Advanced) ... OK
  • Inline HTML (Simple) ... FAILED (see Note 2)
  • Inline HTML comments ... FAILED (see Note 2)
  • Links, inline style ... OK
  • Links, reference style ... OK
  • Links, shortcut references ... OK
  • Literal quotes in titles ... FAILED (see Note 3)
  • Markdown Documentation - Basics ... OK
  • Markdown Documentation - Syntax ... FAILED (see Note 2)
  • Nested blockquotes ... OK
  • Ordered and unordered lists ... OK
  • Strong and em together ... OK
  • Tabs ... OK
  • Tidyness ... OK

18 passed; 5 failed.
Benchmark: 2 wallclock secs ( 0.02 usr 0.01 sys + 1.78 cusr 0.68 csys = 2.49 CPU)


  1. Note:

    Fails because Txtmark doesn't produce empty 'title' image attributes. (IMHO: Images ... OK)
  2. Note:

    Fails because of currently missing block-level HTML identification.
  3. Note:

    What the frell ... this test will continue to FAIL. Sorry, but using unescaped '"' in a link, which should be surrounded by '"' is unacceptable for me ;)

    Change:

     Foo [bar](/url/ "Title with "quotes" inside").
     [bar]: /url/ "Title with "quotes" inside"
    

    to:

     Foo [bar](/url/ "Title with \"quotes\" inside").
     [bar]: /url/ "Title with \"quotes\" inside"
    

    and Txtmark will produce the correct result.
    (IMHO: Literal quotes in titles ... OK)

Performance comparison of markdown processors for the JVM


Based on this.
Txtmark's results should not be considered final, they may change in either direction during the upcoming releases.
But I think you get the point.

TestActuariusPegDownKnockoffTxtmark
1st Run (ms)2nd Run (ms)1st Run (ms)2nd Run (ms)1st Run (ms)2nd Run (ms)1st Run (ms)2nd Run (ms)
Plain Paragraphs1213301128294460034012545
Every Word Emphasized15799131482147312840126635143
Every Word Strong1142100411311110950596153939
Every Word Inline Code37427510641030911890754935
Every Word a Fast Link21721569545530395133858844
Every Word Consisting of Special XML Chars400842433029331931636313031270
Every Word wrapped in manual HTML tags3041287488788837763472570530
Every Line with a manual line break4575301325129713409814643
Every word with a full link359277999952171316589150
Every word with a full image20914310971068185217563333
Every word with a reference link99449098183261831811625911561714671313
Every block a quote431210131913284774693737
Every block a codeblock67953743781661746222
Every block a list852865170616735996224739
All tests together331329045273533397329698194190

[Markdown] is copyright (c) 2004 by John Gruber [Markdown]: http://daringfireball.net/projects/markdown/ [Actuarius] is copyright (c) 2010 by Christoph Henkelmann [Actuarius]: http://henkelmann.eu/projects/actuarius/ [Knockoff] is copyright (c) 2009-2011 by Tristan Juricek [Knockoff]: http://tristanhunt.com/projects/knockoff/ [PegDown] is copyright (c) 2010 by Mathias Doenitz [PegDown]: https://github.com/sirthias/pegdown


Project link: https://github.com/rjeschke/txtmark