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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -