Code Monkey home page Code Monkey logo

Comments (8)

tylerlong avatar tylerlong commented on May 29, 2024

我不是作者,我猜测样式表应该是这个: https://github.com/pandao/editor.md/blob/master/src/scss/github-markdown.scss

如果你实验出了正确答案,也请劳烦在这里更新下,谢谢!

from editor.md.

pandao avatar pandao commented on May 29, 2024

只需要一个样式文件就可以了,<link rel="stylesheet" href="../dist/css/editormd.preview.css" />

JS文件也要引用,示例:

<script src="js/jquery.min.js"></script>
<script src="../lib/marked.min.js"></script>
<script src="../lib/prettify.min.js"></script>

<!-- 如果有使用flowchart和sequence-diagram才引用 -->   
<script src="../lib/raphael.min.js"></script>
<script src="../lib/underscore.min.js"></script>
<script src="../lib/sequence-diagram.min.js"></script>
<script src="../lib/flowchart.min.js"></script>
<script src="../lib/jquery.flowchart.min.js"></script>

<script src="../editormd.js"></script> 

from editor.md.

 avatar commented on May 29, 2024

不行.... 是不是缺少个初始化函数之类的东西?

from editor.md.

pandao avatar pandao commented on May 29, 2024

把代码贴出来,不然不清楚是什么问题。

from editor.md.

 avatar commented on May 29, 2024
<!DOCTYPE html>
<html lang="zh">
    <head>
        <meta charset="utf-8" />
        <title>
            完整示例 - Editor.md examples
        </title>
        <link rel="stylesheet" href="../editor.md/dist/css/editormd.preview.css" />
        <script type="text/javascript" src="../editor.md/examples/js/jquery.min.js" ></script>
        <script type="text/javascript" src="../editor.md/lib/marked.min.js" ></script>
        <script type="text/javascript" src="../editor.md/lib/prettify.min.js" ></script>
        <script type="text/javascript" src="../editor.md/lib/raphael.min.js" ></script>
        <script type="text/javascript" src="../editor.md/lib/underscore.min.js" ></script>
        <script type="text/javascript" src="../editor.md/lib/sequence-diagram.min.js" ></script>
        <script type="text/javascript" src="../editor.md/lib/flowchart.min.js" ></script>
        <script type="text/javascript" src="../editor.md/lib/jquery.flowchart.min.js" ></script>
        <script type="text/javascript" src="../editor.md/dist/js/editormd.js" ></script>
    </head>
    <body>
        <table>
            <thead>
                <tr>
                    <th>
                        adasa
                    </th>
                    <th>
                        adsa
                    </th>
                    <th>
                        ad
                    </th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>
                        ad
                    </td>
                    <td>
                        ada
                    </td>
                    <td>
                        asda
                    </td>
                </tr>
                <tr>
                    <td>
                        adsd
                    </td>
                    <td>
                        asda
                    </td>
                    <td>
                        ads
                    </td>
                </tr>
            </tbody>
        </table>
        </div>
        </form>
    </body>
</html>

adasa adsa ad
ad ada asda
adsd asda ads

from editor.md.

tylerlong avatar tylerlong commented on May 29, 2024

如果你用的是最新版本的话,相关路径要更新下。 因为dist目录已经不存在了。

你看看浏览器控制台有没有提示你404错误。

from editor.md.

pandao avatar pandao commented on May 29, 2024

@noah1996 你的使用方法不对,请参考这个示例 https://pandao.github.io/editor.md/examples/html-preview-markdown-to-html.html

var testEditormdView = editormd.markdownToHTML("test-editormd-view", {
    markdown : "markdown",
    //htmlDecode : true,       // 开启HTML标签解析,为了安全性,默认不开启
    htmlDecode : "style,script,iframe",  // you can filter tags decode
    emoji : true,
    taskList : true,
    tex : true,
    flowChart: true,
    sequenceDiagram : true, 
});

from editor.md.

 avatar commented on May 29, 2024

非常感谢两位的耐心解答 @pandao @tylerlong
有了pandao大哥的示例就没问题了,
谢谢

from editor.md.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.