573
edits
m (→Known Limitations: add radi's feedback) |
((back to work!) fixed the issue with newlines, wiki source should be way more readable now) |
||
| Line 31: | Line 31: | ||
== Known Limitations == | == Known Limitations == | ||
* newline2br should also insert CR/LF for separating paragraphs in the cquote (also, the trailing slash is not added) {{ | * <s>newline2br</s> addNewline() should also insert CR/LF for separating paragraphs in the cquote (also, the trailing slash is not added) {{done}} | ||
* quoting code doesn't yet work properly {{Not done}} | * quoting code doesn't yet work properly {{Not done}} | ||
* our regexes may fail once the HTML DOM of the source changes (e.g. phpBB/theme update), so we should better show a warning when that's the case {{Not done}} | * our regexes may fail once the HTML DOM of the source changes (e.g. phpBB/theme update), so we should better show a warning when that's the case {{Not done}} | ||
| Line 94: | Line 94: | ||
phpBB_code2syntaxhighlight(), // FIXME: could be much better, see below | phpBB_code2syntaxhighlight(), // FIXME: could be much better, see below | ||
phpBB_quote2cquote(), | phpBB_quote2cquote(), | ||
escapeEquals()] | escapeEquals(), | ||
addNewlines()] | |||
}, | }, | ||
author: { | author: { | ||
| Line 173: | Line 174: | ||
return html.replace(/<img.*?src="(.*?)".*?>/g, "(see the [$1 linked image])"); | return html.replace(/<img.*?src="(.*?)".*?>/g, "(see the [$1 linked image])"); | ||
}; | }; | ||
} | |||
// puts newlines where it makes for more readable wiki "source" | |||
function addNewlines() { | |||
return function(html) { | |||
html = html.replace(/<br\/?>/g,"<br/>\n"); | |||
html = html.replace(/(<\/?[uo]l>)/g,"$1\n"); | |||
return html.replace(/<\/li>/g,"</li>\n"); | |||
} | |||
} | } | ||
| Line 211: | Line 221: | ||
} | } | ||
} | } | ||
// escapes the equal sign that can be problematic inside a template. | // escapes the equal sign that can be problematic inside a template. | ||
// Must be used AFTER html tags were converted, or they get messed up. | // Must be used AFTER html tags were converted, or they get messed up. | ||
| Line 219: | Line 229: | ||
} | } | ||
} | } | ||
/////////////////// | /////////////////// | ||
edits