Skip to content

Commit ab7f539

Browse files
author
Matt Daly
committed
Escaped characters matching emphasis syntax now preserved. Closes #10
1 parent 874cfd2 commit ab7f539

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

app/assets/js/fountain.min.js

+9-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fountain.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// fountain-js 0.1.9
1+
// fountain-js 0.1.10
22
// http://www.opensource.org/licenses/mit-license.php
33
// Copyright (c) 2012 Matt Daly
44

@@ -191,7 +191,7 @@
191191
var styles = [ 'underline', 'italic', 'bold', 'bold_italic', 'italic_underline', 'bold_underline', 'bold_italic_underline' ]
192192
, i = styles.length, style, match;
193193

194-
s = s.replace(regex.note_inline, inline.note).replace(/\n/g, inline.line_break);
194+
s = s.replace(regex.note_inline, inline.note).replace(/\\\*/g, '[star]').replace(/\\_/g, '[underline]').replace(/\n/g, inline.line_break);
195195

196196
// if (regex.emphasis.test(s)) { // this was causing only every other occurence of an emphasis syntax to be parsed
197197
while (i--) {
@@ -204,7 +204,7 @@
204204
}
205205
// }
206206

207-
return s.trim();
207+
return s.replace(/\[star\]/g, '*').replace(/\[underline\]/g, '_').trim();
208208
};
209209

210210
var parse = function (script, toks, callback) {

0 commit comments

Comments
 (0)