Skip to content

Commit 100b6c4

Browse files
Gianmarco SpinaciGianmarco Spinaci
authored andcommitted
Math formula are stored inside a not editable figure
1 parent 4c33500 commit 100b6c4

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

app/js/raje-core/core.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/js/raje-core/plugin/raje_figures.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,9 @@ tinymce.PluginManager.add('raje_formula', function (editor, url) {
321321
let selectedElement = $(tinymce.activeEditor.selection.getNode())
322322

323323
// Open formula editor clicking on math formulas
324-
if (selectedElement.parents(FIGURE_SELECTOR).length && selectedElement.children('svg[role=math]').length) {
325-
324+
if (selectedElement.is(FIGURE_FORMULA_SELECTOR)) {
326325
openFormulaEditor({
327-
formula_val: selectedElement.children('svg[role=math]').attr('data-math-original-input'),
326+
formula_val: selectedElement.find('svg[role=math]').attr('data-math-original-input'),
328327
formula_id: selectedElement.parents(FIGURE_SELECTOR).attr('id')
329328
})
330329
}
@@ -354,6 +353,8 @@ tinymce.PluginManager.add('raje_formula', function (editor, url) {
354353

355354
captions()
356355

356+
//selectRange($(newFormula).next('p')[0], 0)
357+
357358
// Update Rendered RASH
358359
updateIframeFromSavedContent()
359360
})
@@ -378,8 +379,7 @@ tinymce.PluginManager.add('raje_formula', function (editor, url) {
378379
*
379380
*/
380381
create: function (formula_svg, id) {
381-
//return `<figure id="${id}"><p><span role="math" contenteditable="false">\`\`${formula_input}\`\`</span></p></figure>`
382-
return `<figure id="${id}"><p><span contenteditable="false">${formula_svg[0].outerHTML}</span></p></figure>`
382+
return `<figure id="${id}" contenteditable="false"><p><span>${formula_svg[0].outerHTML}</span></p></figure><p><br/></p>`
383383
}
384384
}
385385
})

0 commit comments

Comments
 (0)