I have the following object:
{
"_id": "59f6f931d20f73000410bbd8",
"title": "Test",
"salary": "1337",
"maxSalary": "4000",
"minSalary": "1500",
"introText": "Lorem __Ipsum__ Sit Dolor Amet",
"expectText": "Lorem Ipsum Sit _Dolor__ Amet Est __Circa__."
}
In my Vue.js app I implemented vue-markdown
to render the markdown to display bold and cursive words.
What I now have to implement is, to parse the object for every __word __ and replace it with regex to word .
What I got so far:
let objJson = JSON.stringify(obj);
objJson = objJson.replace(/\_/g, '');
let jobXML = JSON.parse(objJson);
res.send(jobXML);
So this is my workaround to delete the "__" characters but I did not find any other resource which explains how to replace it with my HTML entity.
My workaround is needed because I use /jobs
to display all the jobs in my vue app (which can use markdown), but I have also another express route that can not use "__" but needs the HTMl entities.