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

我觉得不应该直接在body上replaceChild #78

Open
koeltp opened this issue May 22, 2017 · 1 comment
Open

我觉得不应该直接在body上replaceChild #78

koeltp opened this issue May 22, 2017 · 1 comment

Comments

@koeltp
Copy link

koeltp commented May 22, 2017

我觉得不应该直接在body上replaceChild,这样很不好自定义样式。
document.body.replaceChild(newNode, markdownEl);

我觉得最好是在xmp上指定要插入markdown代码的ID。
如下:
` <div id="


    <xmp theme="united" style="display:none;" contente-id="content">
        ### 这里是markdown内容
    </xmp>`


`document.getElementById("content").replaceChild(newNode, markdownEl);`

望采纳。

@daboxu
Copy link

daboxu commented May 23, 2017

Translated to English for visibility:

It would be better if we can specify the markdown text ID on xmp's attribute instead of directly replce child on the body. Example:

<div id="content"></div>
<xmp theme="united" style="display:none;" contente-id="content">
     ### markdown content here ###
</xmp>

so we can try something like

document.getElementById("content").replaceChild(newNode, markdownEl);

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

No branches or pull requests

2 participants