braft-convert
Advanced tools
Comparing version 2.1.5 to 2.1.6
@@ -423,13 +423,20 @@ "use strict"; | ||
if (previousBlockType !== 'code-block' && nextBlockType !== 'code-block') { | ||
if (previousBlockType !== 'code-block' && nextBlockType === 'code-block') { | ||
return { | ||
start: '<pre>', | ||
end: '</pre>' | ||
start: '<pre><code>', | ||
end: '</code>' | ||
}; | ||
} | ||
if (previousBlockType === 'code-block' && nextBlockType !== 'code-block') { | ||
return { | ||
start: '<code>', | ||
end: '</code></pre>' | ||
}; | ||
} | ||
if (previousBlockType !== 'code-block') { | ||
return { | ||
start: '<pre>', | ||
end: '<br/>' | ||
start: '<pre><code>', | ||
end: '</code></pre>' | ||
}; | ||
@@ -440,4 +447,4 @@ } | ||
return { | ||
start: '', | ||
end: '</pre>' | ||
start: '<pre><code>', | ||
end: '</code></pre>' | ||
}; | ||
@@ -447,4 +454,4 @@ } | ||
return { | ||
start: '', | ||
end: '<br/>' | ||
start: '<code>', | ||
end: '</code>' | ||
}; | ||
@@ -631,2 +638,10 @@ } else if (blocks[blockType]) { | ||
}; | ||
} else if (nodeName === 'pre') { | ||
node.innerHTML = node.innerHTML.replace(/<\/code><code>/g, '<br/>').replace(/<code>/g, '').replace(/<\/code>/g, ''); | ||
return { | ||
type: 'code-block', | ||
data: {} | ||
}; | ||
} else if ((nodeStyle.textAlign || nodeStyle.textIndent) && blockNames.indexOf(nodeName) > -1) { | ||
@@ -633,0 +648,0 @@ |
{ | ||
"name": "braft-convert", | ||
"version": "2.1.5", | ||
"version": "2.1.6", | ||
"description": "A convert helper for Braft Editor.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67579
650