- that won’t open up a new tab,
- plain html is perfectly valid in a markdown document.
- it’s the only way to do it. markdown standard only allows the title and href attributes, when using the link format.
- The challenge is to figure it out and make it open up in a new tab. (It can)
- I understand, but that is not what was asked in the user story.
- No, it is not the only way to do it. This forum uses markdown and links open up in a new tab, the example project also opens it’s link in a new tab, in addition I’ve also made it work. Like I said earlier, you have to customize the default render of
marked.js. to make it work.
- the user story simply asked that the link open in a new tab. That would allow any valid markdown, including plain html.
- that’s interesting but non-standard behavior. how is it done without specifying target?
Do you really think the intention was to have the student modify marked.js source code?
Your rendered html will have the
target="_blank" attribute, but you have to figure out how to make
marked.js generate that attribute.
And no, you will not be modifying the
marked.js source code, just use the options/extensions they provide. Read the link I shared above.
If you inspect that link you just made with Chrome dev tools you’ll see that there is no target attribute.
I looked at all those options and didn’t see it.
More hints : the option of interest is
renderer, that option takes a value of an object as you can see in the docs. After you find the property on that object you want to change, you make a new instance, modify it after figuring out the arguments to pass and pass it back to your
marked call as an optional argument. And remember, google is your friend. Best of luck.
sry Mr.Harplinge , i think dereje is right about modifying the render.