Microdown icon indicating copy to clipboard operation
Microdown copied to clipboard

Inner parser inconsistent wrt syntax errors

Open kasperosterbye opened this issue 3 years ago • 1 comments

The inline parser mostly translates syntax errors into the markup as plain text, which I like. But it is not quite consistent as these examples show:

MicInlineParser new parse: 'aaa**bbb' >>> an Array(Text(aaa**bbb))
MicInlineParser new parse: 'aaa**bbb`ccc**`ddd' >>> an Array(Text(aaa**bbb`ccc**`ddd))
MicInlineParser new parse: 'xxx_aaa**bbb`ccc**`ddd_yyy' >>> 
   an Array(Text(xxx) ItalicFormat(Text(aaa**bbb) MonospaceFormat(Text(ccc**)) Text(ddd)) Text(yyy))

All error handlings make sense I think. However, the second and third seems to follow different principles.

  • In example 2 the inner monospace is not recognised
  • I might have expected the result to be #( Text(aaa**bbb) Monospace(ccc**) Text( ddd)).
  • This is what example 3 does, though in the context of italic.

Perhaps, it is not that important what it does in case of errors, as long as the fallback text generation makes some kind of sense.

kasperosterbye avatar Oct 12 '22 15:10 kasperosterbye

I added a wontfix label, as this one should not be worked on, but should be handled if #462 is picked up

kasperosterbye avatar Oct 19 '22 12:10 kasperosterbye