dools.markup
Client-side markup parser
Examples:
Input text:
> this is a blockquote with a continuation This is not > a block quote > This is a > > nested block > > quote.
Parse results (html output):
Syntax defnition:
var testSyntax = { tokens: [ // blockquotes { start: '>\\s*', end: '\n(?=[\n>\\* ])', mode: 'blockquoteLine', restoreEnd: [0], args: {grouped: true}, token: dools.markup.BlockquoteToken }, { start: '\n(?=>)', mode: 'blockquoteLine', args: {grouped: true}, token: dools.markup.BlockquoteToken }, // very simple list item for test { start: '\\*(.*)', mode: 'listItem', token: dools.markup.ListItemToken }, { start: '\n', mode: 'text', token: dools.markup.TextToken }, { start: '\\s+>', mode: 'text', token: dools.markup.TextToken }, { start: '\\s*[-A-Za-z0-9\\.\\,]+', mode: 'text', token: dools.markup.TextToken }, // for stray whitespace at the end of the buffer (eliminates the // "Cutting one char from input text" warning). { start: '\\s+$', mode: 'text', token: dools.markup.TextToken } ] };
Process