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

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

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -