Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Will be intact in this case #942

Closed
pea3nut opened this issue Oct 1, 2017 · 4 comments
Closed

Will be intact in this case #942

pea3nut opened this issue Oct 1, 2017 · 4 comments
Labels

Comments

@pea3nut
Copy link

pea3nut commented Oct 1, 2017

var mdSource =`
<div></div><p></p>

# title

text

<div></div>
`;
var Marked =require('marked');
console.log(Marked(mdSource));// will be intact
@joshbruce
Copy link
Member

Are those backticks for defining the string literal?

@pea3nut
Copy link
Author

pea3nut commented Dec 2, 2017

Is the backticks means the `?

Yes, It's the ES6 template string.

@joshbruce
Copy link
Member

I could be wrong as I'm not that intimately familiar with Marked's codebase, but I'm pretty sure Marked, as it stands, does not handle ES6 template strings.

Marked uses regular expressions and I'm not sure if the ES6 template string is interpreted by the renderer/regular expression the same way as a pure string literal. Given some other tickets I've seen, I'm also not sure how much of it is the template string literal versus the inclusion of the HTML tags (think there's a flag to allow HTML tags).

Please try following (this should help to inform whether this is a new feature request, or a defect):

// pure string literal
var mdSource ='
<div></div><p></p>

# title

text

<div></div>
';

// remove HTML tags w/ ES6 template string
var mdSource =`# title

text`;

// remove HTML tags w/ pure string literal
// remove HTML tags w/ ES6 template string
var mdSource ='
# title

text';

@joshbruce
Copy link
Member

#985

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants