Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Live markdown editor based on MathJax and Marked

## How it works?

text → Escape tags → MathJax → Unescape some sutff → Markdown → preview
text → Escape tags → MathJax → Unescape some stuff → Markdown → preview

## Demo

Expand Down
8 changes: 4 additions & 4 deletions editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
preview: null, // filled in by Init below
buffer: null, // filled in by Init below

timeout: null, // store setTimout id
timeout: null, // store setTimeout id
mjRunning: false, // true when MathJax is processing
oldText: null, // used to check if an update is needed

Expand Down Expand Up @@ -193,17 +193,17 @@
var inside_code = false;

for (var i = 0; i < lines.length; i++) {
// a hack to properly rendre the blockquotes
// a hack to properly render the blockquotes
if (lines[i].startsWith('&gt;')) {
lines[i] = lines[i].replace(/&gt;/g, '>');
}

// rendrer properly stuff like this
// render properly stuff like this
// ```c
// if (a > b)
// ```
if (inside_code) {
// inside the code we descape stuff
// inside the code we unescape stuff
lines[i] = lines[i]
.replace(/&lt;/g, '<')
.replace(/&gt;/g, '>')
Expand Down