Code Monkey home page Code Monkey logo

katex-mini's Introduction

Hi ~

rojer's github stats

katex-mini's People

Contributors

had0ngzhu avatar rojer95 avatar

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

Watchers

 avatar

katex-mini's Issues

使用之后如何控制richtext的样式?

前端使用了colorui的界面。 目前渲染是正常的。 但是wxml调试器里看不到选然后的richtext,放到view里,view就不见了。如何控制样式? 比如text-align:center

1.1.1版本中矩阵渲染异常

)OG9`X SD} 9I_E9NWZ9679
矩阵中的数字均不能正常显示,其中latex为:

\begin{matrix}` 0 & 1 \\ 1 & 0 \end{matrix}\quad
\begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix}\\
\begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix}\quad
\begin{Bmatrix} 1 & 0 \\ 0 & -1 \end{Bmatrix}\\
\begin{vmatrix} a & b \\ c & d \end{vmatrix}\quad
\begin{Vmatrix} i & 0 \\ 0 & -i \end{Vmatrix}

在此版本前的版本能正常渲染,该版本渲染结果缺失了以下节点:
(~}IE@Z}CN4LFXV TNHP)8K
这个问题似乎是src/index.ts的153行if (!type) return null;导致的,丢失的节点似乎不是"text" | "span" | "svg" | "anchor" | "line" | "path"其中任何一种类型,且删去153行后渲染正常。

svg的部分无法使用css或latex中\color{}设置颜色

由于将svg放置在img内,无法通过css的color或fill属性控制svg的颜色,同时\color{}也使用css控制颜色,导致两种方法均无法设置svg颜色,可以使用css的filter强制转换,或在img中src的svg标签内嵌入fill='color'
A96072344A37562E5BB34A3D25F54B2D

rich-text \n <br> 都不能换行

小程序集成了该库, 转换效果挺好的 , 但是现在遇到一个问题.

index.wxml

... ...

index.wxss ->

...
.latex-container {
word-break:break-all;
width: 100%;
height: 100%;
padding: 6px;
color: #323232;
font-size: 12px;
}
...

index.js ->

import parse from '@rojer/katex-mini'

Page{

data: {
nodes: [],
latex: 9. 用简便方法计算下面各题. 3.8 \\times 1.45+0.38 \\times 4.2+0.038 \\times 13" \\frac{1}{2}+\\frac{1}{4}+\\frac{1}{8}+\\ldots \\ldots+\\frac{1}{128},
},

onShow() {
this.renderLatex()
},

renderLatex: function () {
var content = this.data.latex;
console.log(content)
if (content.includes('\(') && content.includes('\)')) {
content = content.replace(/\(/g, '').replace(/\)/g, '');
}

if (content.includes('\\[') && content.includes('\\]')) {
  content = content.replace(/\\\[/g, '').replace(/\\\]/g, '');
}

if (content.includes('\\\\')) {
  content = content.replace(/\\\\/g, '').replace(/\n/g, '');
}

...

}
}

运行效果如下:
temp

请问大佬有解决方法吗?
非常感谢 !

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.