We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
--hard-line-breaks オプションが有効の場合(hardLineBreaks: true) 、改行のあとの全角スペースが削除されてしまう。
--hard-line-breaks
hardLineBreaks: true
MDの例:
--- vfm: hardLineBreaks: true --- # 吾輩は猫である 吾輩は猫である。名前はまだ無い。 どこで生れたかとんと見当がつかぬ。
この「名前はまだ無い。」のあとの改行が hardLineBreaks: true の効果により <br> タグに変換される。そしてそのあとの全角スペースが消えてしまう。次の出力となる:
<br>
<p> 吾輩は猫である。名前はまだ無い。<br>どこで生れたかとんと見当がつかぬ。</p>
強制改行 <br> のあとの全角スペースが出力されること。
<p> 吾輩は猫である。名前はまだ無い。<br> どこで生れたかとんと見当がつかぬ。</p>
強制改行 <br> のあとの全角スペースが出力されない。
Run vfm with DEBUG=vfm to see detailed log.
vfm
DEBUG=vfm
$ DEBUG=vfm vfm TEST.md vfm vfm ### mdast ### +0ms vfm root[2] (1:1-10:1, 0-85) vfm ├─0 yaml "vfm:\n hardLineBreaks: true" (1:1-4:4, 0-35) vfm └─1 section[2] vfm │ data: {"hName":"section","hProperties":{"class":["level1"],"aria-labelledby":"吾輩は猫である"}} vfm │ depth: 1 vfm ├─0 heading[1] (6:1-6:10, 37-46) vfm │ │ depth: 1 vfm │ │ data: {"hProperties":{"id":"吾輩は猫である"},"id":"吾輩は猫である"} vfm │ └─0 text "吾輩は猫である" (6:3-6:10, 39-46) vfm └─1 paragraph[3] (8:1-9:19, 48-84) vfm ├─0 text " 吾輩は猫である。名前はまだ無い。" (8:1-8:18, 48-65) vfm ├─1 break (8:18-9:1, 65-66) vfm └─2 text " どこで生れたかとんと見当がつかぬ。" (9:1-9:19, 66-84) +0ms vfm vfm ### hast ### +3ms vfm root[1] (1:1-10:1, 0-85) vfm │ data: {"quirksMode":false} vfm └─0 element<section>[2] vfm │ properties: {"className":["level1"],"ariaLabelledBy":["吾輩は猫である"]} vfm ├─0 element<h1>[1] (6:1-6:10, 37-46) vfm │ │ properties: {"id":"吾輩は猫である"} vfm │ └─0 text "吾輩は猫である" (6:3-6:10, 39-46) vfm └─1 element<p>[3] (8:1-9:19, 48-84) vfm │ properties: {} vfm ├─0 text " 吾輩は猫である。名前はまだ無い。" (8:1-8:18, 48-65) vfm ├─1 element<br>[0] (8:18-9:1, 65-66) vfm │ properties: {} vfm └─2 text "\nどこで生れたかとんと見当がつかぬ。" (9:19, 84) +0ms vfm {} +2ms <!doctype html> <html> <head> <meta charset="utf-8"> <title>吾輩は猫である</title> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <section class="level1" aria-labelledby="吾輩は猫である"> <h1 id="吾輩は猫である">吾輩は猫である</h1> <p> 吾輩は猫である。名前はまだ無い。<br>どこで生れたかとんと見当がつかぬ。</p> </section> </body> </html>
The text was updated successfully, but these errors were encountered:
JSで安易に.trim()を使うと引っかかります。 .trim()は全角スペース含めて色々削除します。 CommonMarkのJS実装でもやらかしています。
.trim()
commonmark/commonmark.js#289
CommonMark自体は半角スペース以外のスペースの削除は認めていません。
Sorry, something went wrong.
akabekobeko
No branches or pull requests
Issue Details
--hard-line-breaks
オプションが有効の場合(hardLineBreaks: true
) 、改行のあとの全角スペースが削除されてしまう。MDの例:
この「名前はまだ無い。」のあとの改行が
hardLineBreaks: true
の効果により<br>
タグに変換される。そしてそのあとの全角スペースが消えてしまう。次の出力となる:Expected Behavior
強制改行
<br>
のあとの全角スペースが出力されること。Actual Behavior
強制改行
<br>
のあとの全角スペースが出力されない。Debug log (Any)
Run
vfm
withDEBUG=vfm
to see detailed log.The text was updated successfully, but these errors were encountered: