mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-13 22:54:42 -04:00
Update to support wrap syntax for code block
This commit is contained in:
parent
f93e8f5fdc
commit
211d25253e
4 changed files with 20 additions and 3 deletions
|
@ -448,7 +448,8 @@ function finishView(view) {
|
|||
.each(function (key, value) {
|
||||
var langDiv = $(value).find('code.hljs');
|
||||
if (langDiv.length > 0) {
|
||||
var reallang = langDiv[0].className.replace('hljs', '').trim();
|
||||
var reallang = langDiv[0].className.replace(/hljs|wrap/g, '').trim();
|
||||
if (!reallang) return;
|
||||
var codeDiv = $(value).find('.code');
|
||||
var code = "";
|
||||
if (codeDiv.length > 0) code = codeDiv.html();
|
||||
|
@ -897,7 +898,8 @@ md.renderer.rules.fence = function (tokens, idx, options, env, self) {
|
|||
|
||||
if (info) {
|
||||
langName = info.split(/\s+/g)[0];
|
||||
token.attrJoin('class', options.langPrefix + langName.replace(/\=$|\=\d+$|\=\+$/, ''));
|
||||
if (/\!$/.test(info)) token.attrJoin('class', 'wrap');
|
||||
token.attrJoin('class', options.langPrefix + langName.replace(/\=$|\=\d+$|\=\+$|\!$|\=\!$/, ''));
|
||||
token.attrJoin('class', 'hljs');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue