Hexo: too much whitespace while inserting html table

Created on 3 Feb 2017  ·  4Comments  ·  Source: hexojs/hexo

before you submit your issue, please delete all the example code in template

Environment Info

Node version(node -v)

v5.7.0

Your site _config.yml


Your theme _config.yml

defaul theme, default configuration

Plugin version(npm ls --depth 0)

[email protected] F:web\hexo_test
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
+-- [email protected]
`-- [email protected]

For BUG

I edit my *.md file in sublime, while inserting table in a post like this:

title: test_post
date: 2017-02-02 16:48:31
tags:
---
test start
<table>
    <tr>
        <td>d1</td>
        <td>d2</td>
    </tr>
</table>
end!

I found that too much whitespace was produced before the table, just like this:
image

If I edit my file like this:

title: test_post
date: 2017-02-02 16:48:31
tags:
---
test start
<table><tr><td>d1</td><td>d2</td></tr></table>
end!

the post is produced properly:
image

I don't konw it's hexo's bug or my own fault, and is there any way to keep the code easy to read and rendered properly?
Thanks.

Most helpful comment

Try the following, it fixed the problem for me:

{% raw %}
html tags & content
{% endraw %}

All 4 comments

It is a known marked.js issue. Please use markdown table structure instead of HTML tags.

Thanks

Try the following, it fixed the problem for me:

{% raw %}
html tags & content
{% endraw %}

http://tool.oschina.net/jscompress?type=2
html table compressed into a row
it work for me

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jasoncheng911 picture jasoncheng911  ·  3Comments

demurgos picture demurgos  ·  3Comments

Helihua1992 picture Helihua1992  ·  3Comments

awulkan picture awulkan  ·  3Comments

leoli-dev picture leoli-dev  ·  3Comments