dojox.markup
Client-side markup parser
Examples:
Input text:
## This is a section ## Another section [with inner token] and [another inner token] and [two [level]inner token], just for [test} ## And [[some [tricky} cases} here [and [there]}.
Parse results (html output):
Syntax defnition:
var testSyntax = { tokens: [ { start: '\\[', end: '\\]', mode: 'test', token: dojox.markup.TestToken }, { start: '\\[', end: '\\}', mode: 'italic', token: dojox.markup.ItalicToken }, { start: '\\[\\[', end: '\\}', mode: 'bold', token: dojox.markup.BoldToken }, { start: '\\*\\*', end: '\\*\\*', mode: 'bold', token: dojox.markup.BoldToken }, { start: '\n## *', end: ' *#*\n', mode: "header", args: { level: 2 }, token: dojox.markup.HeaderToken }, { regex: '\n', mode: 'text', token: dojox.markup.TextToken }, { regex: '[-A-Za-z0-9_\\.\\, ]*', mode: 'text', token: dojox.markup.TextToken } ] };
Process