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
在 sequence 代码块内输入标签时,会自动在尾部闭合代码快内出现过的标签,如下所示。
Alice->Bob: 1. sendMessage(message:Message<T>) Bob->Coco: 2. sendMessage(message:Message<T>)
看了下 render.js 的源码,应该是 hexo 中标签插件 {% raw %}的默认行为。
{% raw %}
data.content += sequences.map(function (code, index) { var seqId = getId(index); var codeId = seqId + '-code'; var optionsId = seqId + '-options'; return '' + '{% raw %}' + '<textarea id="' + codeId + '" style="display: none">' + code + '</textarea>' + '<textarea id="' + optionsId + '" style="display: none">' + JSON.stringify(config.options) + '</textarea>' + '<script>' + ' var code = document.getElementById("' + codeId + '").value;' + ' var options = JSON.parse(decodeURIComponent(document.getElementById("' + optionsId + '").value));' + ' var diagram = Diagram.parse(code);' + ' diagram.drawSVG("' + seqId + '", options);' + '</script>' + '{% endraw %}'; }).join('');
解决思路:提前将sequence 代码块中的 < >符号替换为 <和 >,代码如下。
<
>
<
>
data.content += sequences.map(function (code, index) { var seqId = getId(index); var codeId = seqId + '-code'; var optionsId = seqId + '-options'; + code = code.replace(/</g,'<').replace(/>/g,'>'); return '' + '{% raw %}' + '<textarea id="' + codeId + '" style="display: none">' + code + '</textarea>' + '<textarea id="' + optionsId + '" style="display: none">' + JSON.stringify(config.options) + '</textarea>' + '<script>' + ' var code = document.getElementById("' + codeId + '").value;' + ' var options = JSON.parse(decodeURIComponent(document.getElementById("' + optionsId + '").value));' + ' var diagram = Diagram.parse(code);' + ' diagram.drawSVG("' + seqId + '", options);' + '</script>' + '{% endraw %}'; }).join('');
解决后的效果:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
在 sequence 代码块内输入标签时,会自动在尾部闭合代码快内出现过的标签,如下所示。
看了下 render.js 的源码,应该是 hexo 中标签插件
{% raw %}
的默认行为。解决思路:提前将sequence 代码块中的
<
>
符号替换为<
和>
,代码如下。data.content += sequences.map(function (code, index) { var seqId = getId(index); var codeId = seqId + '-code'; var optionsId = seqId + '-options'; + code = code.replace(/</g,'<').replace(/>/g,'>'); return '' + '{% raw %}' + '<textarea id="' + codeId + '" style="display: none">' + code + '</textarea>' + '<textarea id="' + optionsId + '" style="display: none">' + JSON.stringify(config.options) + '</textarea>' + '<script>' + ' var code = document.getElementById("' + codeId + '").value;' + ' var options = JSON.parse(decodeURIComponent(document.getElementById("' + optionsId + '").value));' + ' var diagram = Diagram.parse(code);' + ' diagram.drawSVG("' + seqId + '", options);' + '</script>' + '{% endraw %}'; }).join('');
解决后的效果:
![WeChat4f2801ae91af9846c558bbb731adc245](https://user-images.githubusercontent.com/3816374/60355999-6f558b00-9a02-11e9-92d9-6a06c1dcd2ab.png)
The text was updated successfully, but these errors were encountered: