Author: bugs
Description:
Consider the parsing of these snippets:
//#1
;#term
:def1
:def2
// #2
;#term:def1
:def2
//#3
;#term
:#def1
:#def2
//#4
;#term:def1
:#def2
//#5
;term
:#def1
:#def2
Now, obviously it's far from clear what the semantics are or ought to be, but these aspects of behaviour are weird:
- In snippets #3 and #5, the definitions are rendered like the term itself.
- Snippets #1 and #2 render very differently although they should be equivalent.
- Snippet #4 is perhaps the most likely thing you'd actually want (one term with multiple definitions), but requires the most tortured syntax.
- #4 and #5 seem very similar but produce very output with different indenting and bolding.
- It's quite unfortunate that ";foo:bar" is supposed to act like ";foo<newline>:bar", but no attempt is made to render list elements like ";foo:#bar".
Most of this weirdness seems to be caused by the parser line around "if ($this->findColonNoLinks($t, $term, $t2) !== false)" which treats the part of the line after : as if it was actually a line starting with ;.
Possible resolutions:
- Don't allow any nesting of list items after ";". Treat ;#term as defining the literal string "#term". #; is fine for an ordered list of definitions.
- Make #5 above the canonical way to express a term with a list of definitions, but make it render as #4 above.
- Longer term, totally scrap the ";definition:term" (without newline) syntax. It's not of enormous benefit, makes the parsing more complex, and causes all this weird behaviour.
Version: 1.9.x
Severity: minor