1234567891011121314151617181920212223242526272829303132333435 |
- showdown.subParser('makehtml.blockQuotes', function (text, options, globals) {
- 'use strict';
- text = globals.converter._dispatch('makehtml.blockQuotes.before', text, options, globals);
- text = text.replace(/((^ {0,3}>[ \t]?.+\n(.+\n)*\n*)+)/gm, function (wholeMatch, m1) {
- var bq = m1;
- // attacklab: hack around Konqueror 3.5.4 bug:
- // "----------bug".replace(/^-/g,"") == "bug"
- bq = bq.replace(/^[ \t]*>[ \t]?/gm, '¨0'); // trim one level of quoting
- // attacklab: clean up hack
- bq = bq.replace(/¨0/g, '');
- bq = bq.replace(/^[ \t]+$/gm, ''); // trim whitespace-only lines
- bq = showdown.subParser('makehtml.githubCodeBlocks')(bq, options, globals);
- bq = showdown.subParser('makehtml.blockGamut')(bq, options, globals); // recurse
- bq = bq.replace(/(^|\n)/g, '$1 ');
- // These leading spaces screw with <pre> content, so we need to fix that:
- bq = bq.replace(/(\s*<pre>[^\r]+?<\/pre>)/gm, function (wholeMatch, m1) {
- var pre = m1;
- // attacklab: hack around Konqueror 3.5.4 bug:
- pre = pre.replace(/^ /mg, '¨0');
- pre = pre.replace(/¨0/g, '');
- return pre;
- });
- return showdown.subParser('makehtml.hashBlock')('<blockquote>\n' + bq + '\n</blockquote>', options, globals);
- });
- text = globals.converter._dispatch('makehtml.blockQuotes.after', text, options, globals);
- return text;
- });
|