Git Product home page Git Product logo

lute's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

lute's Issues

SpinVditorDOM bug

SpinVditorDOM 以下代码后会变为宽松列表

<ul data-tight="true" data-marker="*" data-block="0">
    <li data-marker="*"><p>1</p>
        <ul data-tight="true" data-marker="*" data-block="0">
            <li data-marker="*"><p>2</p></li>
        </ul>
    </li>
    <li data-marker="*">
        <p>4
            <wbr>
        </p>
        <ul data-tight="true" data-marker="*" data-block="0"></ul>
        <ul data-tight="true" data-marker="*" data-block="0">
            <li data-marker="*"><p>3</p></li>
        </ul>
    </li>
</ul>

增加一定程度的 XSS 安全过滤

原始需求:Vanessa219/vditor#226

对最终渲染的 HTML 进行一定程度的 XSS 安全过滤,参考 bluemonday 的 UGC 策略进行实现。

  • 加入配置开关 Sanitize,默认不开启 XSS 安全过滤
  • 对于 HTML 渲染器根据开关进行处理
  • 对于 Vditor 渲染器(WG、IR)固定开启处理

Vditor 支持列表切换问题

  • 无序列表切换为有序列表,再输入文字后会变为无序列表
  • 有序列表切换为无序列表,再输入文字后会变为有序列表

支持脚注

https://www.markdownguide.org/extended-syntax

Here's a simple footnote,[^1] and here's a longer one.[^bignote]

[^1]: This is the first footnote.

[^bignote]: Here's one with multiple paragraphs and code.

    Indent paragraphs to include them in the footnote.

    `{ my code }`

    Add as many paragraphs as you like.

@jakekwak Thanks for the proposal

支持自定义标题 ID

### 这是一个标题 {#custom-id}

渲染的 HTML:

<h3 id="custom-id">这是一个标题</h3>

优化 ToC 生成

仅有顶级标题(直接挂在根上的)才纳入 ToC 生成,挂在其他元素下的标题不生成 ToC,比如:

{F2B7B132-DCA6-FC2C-05AE-D52F172C8341}

分包

  • ast
  • parse
  • render
  • util

链接、图片相对路径支持

引入 option.LinkBase 参数:设置链接、图片的基础路径。如果用户在链接或者图片地址中使用相对路径(没有协议前缀且不以 / 开头)并且 LinkBase 不为空则会用该值作为前缀。

比如 LinkBase 设置为 http://domain.com/,对于 ![foo](bar.png) 则渲染为 <img src="http://domain.com/bar.png" alt="foo" />

HTML2Md 没有 2 md

textHTML

<pre class="vditor-textarea" placeholder="placeholder" contenteditable="true" spellcheck="false" style="font-family: &quot;Helvetica Neue&quot;, &quot;Luxi Sans&quot;, &quot;DejaVu Sans&quot;, Tahoma, &quot;Hiragino Sans GB&quot;, &quot;Microsoft Yahei&quot;, sans-serif, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Noto Color Emoji&quot;, &quot;Segoe UI Symbol&quot;, &quot;Android Emoji&quot;, EmojiSymbols; margin: 0px 1px 0px 0px; height: 462px; overflow: auto; width: 640px; -webkit-box-flex: 1; flex: 1 1 0%; border: 0px; resize: none; padding: 10px 9px 231px 10px; box-sizing: border-box; background-color: rgb(250, 251, 252); outline: none 0px; font-size: medium; line-height: 22px; color: var(--textarea-text-color); border-radius: 0px 0px 3px 3px; font-variant-ligatures: no-common-ligatures; white-space: pre-wrap; word-break: break-word; overflow-wrap: break-word; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; display: block;"><span>`a`</span></pre>

vditor.lute.HTML2Md(textHTML)

<pre class="vditor-textarea" placeholder="placeholder" contenteditable="true" spellcheck="false" style="font-family: &#34;Helvetica Neue&#34;, &#34;Luxi Sans&#34;, &#34;DejaVu Sans&#34;, Tahoma, &#34;Hiragino Sans GB&#34;, &#34;Microsoft Yahei&#34;, sans-serif, &#34;Apple Color Emoji&#34;, &#34;Segoe UI Emoji&#34;, &#34;Noto Color Emoji&#34;, &#34;Segoe UI Symbol&#34;, &#34;Android Emoji&#34;, EmojiSymbols; margin: 0px 1px 0px 0px; height: 462px; overflow: auto; width: 640px; -webkit-box-flex: 1; flex: 1 1 0%; border: 0px; resize: none; padding: 10px 9px 231px 10px; box-sizing: border-box; background-color: rgb(250, 251, 252); outline: none 0px; font-size: medium; line-height: 22px; color: var(--textarea-text-color); border-radius: 0px 0px 3px 3px; font-variant-ligatures: no-common-ligatures; white-space: pre-wrap; word-break: break-word; overflow-wrap: break-word; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial; display: block;"><span>`a`</span></pre>

ir 模式 toc 会产生空 p

SpinVditorIRDOM - argument: <div class="vditor-toc" data-block="0" data-type="toc-block" contenteditable="false">    <span data-type="toc-h">fdfs1312ff1111</span><br></div><h3 data-block="0" class="vditor-ir__node" data-marker="#"><span class="vditor-ir__marker vditor-ir__marker--heading">### </span>f1<wbr></h3>
log.ts:6 SpinVditorIRDOM - result: <div class="vditor-toc" data-block="0" data-type="toc-block" contenteditable="false">&emsp;&emsp;&emsp;&emsp;<span data-type="toc-h">f1<wbr></span><br></div><p data-block="0"></p><h3 data-block="0" class="vditor-ir__node vditor-ir__node--expand" data-marker="#"><span class="vditor-ir__marker vditor-ir__marker--heading">### </span>f1<wbr></h3>

Vditor 支持列表 start 错误

SpinVditorDOM - argument: <ol data-tight="true" data-block="0"><li data-marker="2."><p>21<wbr></p></li></ol>
log.ts:6 SpinVditorDOM - result: <ol data-tight="true" start="2" data-block="0"><li data-marker="2.">21<wbr></li></ol>

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.