mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
16 lines
345 B
JavaScript
16 lines
345 B
JavaScript
|
/**
|
||
|
* Created by Estevao on 12-01-2015.
|
||
|
*/
|
||
|
|
||
|
showdown.subParser('italicsAndBold', function (text) {
|
||
|
'use strict';
|
||
|
// <strong> must go first:
|
||
|
text = text.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g,
|
||
|
'<strong>$2</strong>');
|
||
|
|
||
|
text = text.replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g,
|
||
|
'<em>$2</em>');
|
||
|
|
||
|
return text;
|
||
|
});
|