Skip to content

Commit 5eec741

Browse files
committed
fix #18, use all signs by parsing of italic markup
1 parent 226bd71 commit 5eec741

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/markupParser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) {
195195
tag = tag.replace(/\*([^\*]*)\*/g, "<strong>$1</strong>");
196196
// line-through
197197
if ((!html_tag) && (!tag.match('<img')) && (!listFlag)) {
198-
tag = tag.replace(/-([\w ]*)-/g, "<span style='text-decoration: line-through;'>$1</span>");
199-
tag = tag.replace(/_([\w ]*)_/g, "<i>$1</i>");
198+
tag = tag.replace(/\B-([^-]*)-\B/g, " <span style='text-decoration: line-through;'>$1</span> ");
199+
tag = tag.replace(/_([^_]*)_/g, "<i>$1</i>");
200200
}
201201
} else {
202202
if (tag !== `<pre><code style='font-family: ${MONOSPACE_FONT_FAMILY}'>`) {

0 commit comments

Comments
 (0)