code highlighting working
This commit is contained in:
1 parent
a408fff269
commit
3fffab8644
1 file changed
+10
-6
@@ -228,9 +228,13 @@ function newSuperalgosDocSpace() {
|
||||
*/
|
||||
let paragraphs = []
|
||||
let paragraph = ''
|
||||
let splittedSelectedParagraph = selectedParagraph.id.split('-')
|
||||
let selectedParagraphIndex = Number(splittedSelectedParagraph[1])
|
||||
let selectedParagraphStyle = splittedSelectedParagraph[2]
|
||||
let style = selectedParagraphStyle.charAt(0).toUpperCase() + selectedParagraphStyle.slice(1);
|
||||
|
||||
for (let i = 0; i < textArea.value.length; i++) {
|
||||
if (textArea.value.charCodeAt(i) === 10) {
|
||||
if (textArea.value.charCodeAt(i) === 10 && style !== 'Javascript' && style !== 'Json') {
|
||||
if (paragraph !== '') {
|
||||
paragraphs.push(paragraph)
|
||||
}
|
||||
@@ -241,11 +245,6 @@ function newSuperalgosDocSpace() {
|
||||
}
|
||||
paragraphs.push(paragraph)
|
||||
|
||||
let splittedSelectedParagraph = selectedParagraph.id.split('-')
|
||||
let selectedParagraphIndex = Number(splittedSelectedParagraph[1])
|
||||
let selectedParagraphStyle = splittedSelectedParagraph[2]
|
||||
let style = selectedParagraphStyle.charAt(0).toUpperCase() + selectedParagraphStyle.slice(1);
|
||||
|
||||
if (paragraphs.length === 1) {
|
||||
/* There is no need to add new paragraphs, we just update the one we have. */
|
||||
if (paragraphs[0] !== '') {
|
||||
@@ -564,6 +563,11 @@ function newSuperalgosDocSpace() {
|
||||
|
||||
let docsAppDiv = document.getElementById('docsDiv')
|
||||
docsAppDiv.innerHTML = HTML + addFooter()
|
||||
_self.Prism.highlightAllUnder(docsAppDiv, true, onHighlighted)
|
||||
|
||||
function onHighlighted() {
|
||||
// nothing to do here
|
||||
}
|
||||
|
||||
addProjectImage(project)
|
||||
|
||||
|
||||
Reference in new issue
Block a user