node.js - How to escape special characters from a markdown string? -


i have markdown file (utf8) turning html file. current setup pretty straight forward (pseudo code):

var file = read(site.postlocation + '/in.md', 'utf8'); var escaped = marked( file ); write('out.html', escaped); 

this works great, i've run issue there special characters in markdown file (such é) messed when viewed in browser (é).

i've found couple of npm modules can convert html entities, convert convertable characters. including required markdown syntax (for example '#' becomes '#' , '.' becomes '.' , markdown parser fail.

i've tried libs entities , node-iconv.

i imagine being pretty standerd problem. how can replace strange letter characters without markdown required symbols?

as pointed out hilarudeens forgot include meta charset html tag.

<meta charset="utf-8" /> 

if come across similar issues, suggest check first.


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -