Skip to content

Commit

Permalink
修复了latex插件部分情况下不显示的问题 #515
Browse files Browse the repository at this point in the history
  • Loading branch information
jin-yufeng committed May 13, 2023
1 parent ca66d5e commit 38402ca
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions plugins/latex/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@ Latex.prototype.onParse = function (node, vm) {
// 偶数
if ((index + 1) % 2 === 0) {
return {
name: 'span',
name: 'div',
attrs: {},
f: 'display:inline-block',
children: parse.default(str)
}
}
return {
type: 'text',
text: str
}
})
}).filter(node => node.name || node.text)
delete node.text
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/miniprogram/node/node.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<!-- #endif -->
<!-- insert -->
<!-- 富文本 -->
<rich-text wx:else id="{{n.attrs.id}}" mp-weixin:mp-qq:mp-baidu:mp-toutiao:style="{{n.f}}" mp-alipay:style="{{n.f}};display:inline" mp-baidu:selectable="{{opts[4]}}" mp-weixin:user-select="{{opts[4]}}" nodes="{{[n]}}" />
<rich-text wx:else id="{{n.attrs.id}}" mp-weixin:mp-qq:mp-baidu:mp-toutiao:style="{{n.f}}" mp-alipay:style="display:inline;{{n.f}}" mp-baidu:selectable="{{opts[4]}}" mp-weixin:user-select="{{opts[4]}}" nodes="{{[n]}}" />
</template>
<!-- #ifdef MP-ALIPAY || MP-TOUTIAO -->
<template name="node">
Expand Down
2 changes: 1 addition & 1 deletion src/uni-app/components/mp-html/node/node.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<rich-text v-else-if="!n.c&&!handler.isInline(n.name, n.attrs.style)" :id="n.attrs.id" :style="n.f" :user-select="opts[4]" :nodes="[n]" />
<!-- #endif -->
<!-- #ifndef H5 || ((MP-WEIXIN || MP-QQ || APP-PLUS || MP-360) && VUE2) -->
<rich-text v-else-if="!n.c" :id="n.attrs.id" :style="n.f+';display:inline'" :preview="false" :selectable="opts[4]" :user-select="opts[4]" :nodes="[n]" />
<rich-text v-else-if="!n.c" :id="n.attrs.id" :style="'display:inline;'+n.f" :preview="false" :selectable="opts[4]" :user-select="opts[4]" :nodes="[n]" />
<!-- #endif -->
<!-- 继续递归 -->
<view v-else-if="n.c===2" :id="n.attrs.id" :class="'_block _'+n.name+' '+n.attrs.class" :style="n.f+';'+n.attrs.style">
Expand Down

0 comments on commit 38402ca

Please sign in to comment.