Edgewall Software

Changes between Initial Version and Version 1 of TracDev/Proposals/VerticalHorizontalParsing


Ignore:
Timestamp:
Jan 24, 2010, 10:27:59 PM (14 years ago)
Author:
Christian Boos
Comment:

explain what I meant with vertical/horizontal wiki parsing

Legend:

Unmodified
Added
Removed
Modified
  • TracDev/Proposals/VerticalHorizontalParsing

    v1 v1  
     1= Vertical vs. Horizontal Parsing in Trac Wiki =
     2
     3When one look at a Trac Wiki markup source, the primary structure one can see is along the "vertical" direction.
     4
     5Of course, one can find in nearly any text a vertical sequence of group of lines ("paragraphs"), vertically isolated lines corresponding to section titles, etc.
     6
     7But in Trac or other wiki markups, this goes further:
     8 - wiki processors use "blocks" of lines (`{{{` ... `}}}`), eventually nested
     9 - lists, blockquotes, definition lists all rely on a consistent indentation,
     10 - citation quotes ('> ...') also stand out first in the vertical direction
     11
     12Yet the wiki parsing up to Trac 0.11 is heavily line oriented. The detection of code blocks is one exception to this, where matching `{{{` / `}}}` pairs of lines are first detected, then their content processed,  even recursively if needed.
     13
     14By analyzing the structure of lines one after the other, one has to maintain a lot of state in order to keep a correct sense of context. Also the code is often fragile as it's not always obvious to decide what HTML elements have to be closed first before proceeding.
     15
     16The idea with VH parsing is that the existing vertical structure in the markup should be exploited first before tackling the horizontal parsing, which is better suited to intra-paragraph markup.
     17
     18In 0.12, the parsing of citation quotes ('> ...') now uses this approach, and this enabled to address the #4235 issue in a comprehensive way relatively painlessly.
     19
     20In future versions, the lists and other kind of markup could also benefit from this approach.