Closed SukkaW closed 4 years ago
My (rough) understanding is that xmlMode
is only intended for dealing with XML file/content. It can cause unintended result when using with HTML.
For example in a code block of xml code, notice the undesired blank lines below the codes when I enable xmlMode,
It's back to normal once I disable xmlMode,
I noticed that issue before, but couldn't reproduce reliably. Do you have sample repo that I can test?
You could also try the v2.0 branch which includes https://github.com/cheeriojs/dom-serializer/pull/85, but it's not directly related to the issue.
When I use
hexo-nofollow
, the</head><body>
tag will be placed in a wrong position like this:When I use an older version of
hexo-autonofollow
, the problem disappear, the</head><body>
will be in the right place.The issue might related to https://github.com/cheeriojs/cheerio/issues/1031 , and could be solved by adding
xmlMode: true
in thecheerio.load
config to avoid this.https://github.com/curbengh/hexo-nofollow/blob/b91feb8d32ed3980f734dbb19f2a0f9885109936/lib/filter.js#L43-L45