hexojs / hexo-renderer-markdown-it

Markdown-it is a Markdown parser, done right. A faster and CommonMark compliant alternative for Hexo.
MIT License
341 stars 60 forks source link

Some problems interpreting code ?!? #144

Open andretietz opened 3 years ago

andretietz commented 3 years ago

I just noticed on my website, linked markdown is not correctly interpreted into html. (See website article with the problem.)

Also, I noticed that every linebreak in markdown is translated into an html linebreak. Even though it shouldn't. This is important for writing markdown, since at the moment I need to write every thing in a single line, which I don't want to have. This is part of the markdown definition:

Both of this problems are no parser(markdown-it) problems, according to this

yoshinorin commented 3 years ago

@andretietz

I just noticed on my website, linked markdown is not correctly interpreted into html. (See website article with the problem.)

temporary solution

Would you please remove space from below line?

  override fun adapt(call: Call<Any>): RETURN_TYPE {
    registration[RequestIdentifier.identify(call.request())] = info
    return adapter.adapt(call)
  }
}
+``` 
-```
andretietz commented 3 years ago

Indeed, I've overseen this. It solved the first problem (at least on my website)

The problem with the linebreaks still remaining.

andretietz commented 3 years ago

Also found the problem with the line break.

by configuration linebreaks will be directly translated into <br />

Compare with the option for linebreaks here

Any config change doesn't seem to have any effect.

I just added:

markdown:
  preset: 'zero'

to my main _config.yml and as this wasn't working to the _config.yml of my theme.. Both don't seem to have any effect.

NosedN commented 3 years ago

Also found the problem with the line break.

You can changenode_modules/hexo-renderer-markdown-it/index.js such as


hexo.config.markdown.render = Object.assign({
  html: true,
  xhtmlOut: false,
- breaks: true,
+ breaks: false,
  linkify: true,
  typographer: true,
  quotes: '“”‘’'
}, hexo.config.markdown.render);```