Skip to content
This repository has been archived by the owner on Sep 17, 2023. It is now read-only.

Commit

Permalink
✨ feat(软换行): 完成软换行适配
Browse files Browse the repository at this point in the history
  • Loading branch information
2234839 committed May 23, 2021
1 parent 86ce8ec commit 457c6eb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
8 changes: 6 additions & 2 deletions src/views/assets/js_css/github-markdown-css.css
Original file line number Diff line number Diff line change
Expand Up @@ -1081,9 +1081,13 @@ pre:hover .vditor-copy {
height: 420px;
}
/* 标题块后面的链接图标显示控制 */
.vditor-anchor img{
.vditor-anchor img {
visibility: hidden;
}
.vditor-anchor:hover img{
.vditor-anchor:hover img {
visibility: visible;
}
/* 对于 \n 这样的换行显示出换行效果 */
p[data-n-id] {
white-space: pre-wrap;
}
14 changes: 5 additions & 9 deletions src/views/component/block-ref.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@
{{ .Title }}
</a> -->
<!-- 自定义组件实现 -->
{{ define "blockRef" }}
<!-- 需要注意的是这块的内容一般会被包含在 <p/> 内,而<p/>内是不支持块级元素的,所以下面的自定义组件内也不能有块级元素 -->
<span>
<md2website-block-ref src="{{ .Src }}" title="{{ .Title }}"
><!-- 这里想使用 <slot/> 嵌入,渲染效果应该会更好,但那就可能会引入块级元素...
<!-- 这里想使用 <slot/> 嵌入,渲染效果应该会更好,但那就可能会引入块级元素...
所以还没想好这块到底怎么处理,
可能之后会选择将块级元素全部转为 <span/>
再使用 <slot/> 嵌入
{{ .Title }} -->{{ .Title }}</md2website-block-ref
>
</span>

{{ end }}
{{ .Title }} -->
{{ define "blockRef" }}<md2website-block-ref src="{{ .Src }}" title="{{ .Title }}">
{{ .Title }}
</md2website-block-ref >{{ end }}

0 comments on commit 457c6eb

Please sign in to comment.