diff --git a/src/resources/markdown-it.js b/src/resources/markdown-it.js index 54490c95..31282867 100644 --- a/src/resources/markdown-it.js +++ b/src/resources/markdown-it.js @@ -60,7 +60,7 @@ mdit = mdit.use(window.markdownitHeadingAnchor, { toc.push({ level: getHeadingLevel(openToken.tag), anchor: anchor, - title: inlineToken.content + title: escapeHtml(inlineToken.content) }); } }); diff --git a/src/resources/markdown_template.js b/src/resources/markdown_template.js index 36fa6aec..1ea3b30b 100644 --- a/src/resources/markdown_template.js +++ b/src/resources/markdown_template.js @@ -313,3 +313,16 @@ var insertImageCaption = function() { var finishLogics = function() { content.finishLogics(); }; + +// Escape @text to Html. +var escapeHtml = function(text) { + var map = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + + return text.replace(/[&<>"']/g, function(m) { return map[m]; }); +}; diff --git a/src/resources/showdown.js b/src/resources/showdown.js index 33e77cb7..cec52b3e 100644 --- a/src/resources/showdown.js +++ b/src/resources/showdown.js @@ -24,7 +24,7 @@ var parseHeadings = function(html) { toc.push({ level: level, anchor: ele.id, - title: ele.innerText + title: ele.innerHTML }); } diff --git a/src/veditwindow.cpp b/src/veditwindow.cpp index 0ae3f565..9abea75c 100644 --- a/src/veditwindow.cpp +++ b/src/veditwindow.cpp @@ -43,8 +43,8 @@ VEditWindow::VEditWindow(VNote *vnote, VEditArea *editArea, QWidget *parent) void VEditWindow::initTabActions() { m_locateAct = new QAction(QIcon(":/resources/icons/locate_note.svg"), - tr("Locate To Directory"), this); - m_locateAct->setToolTip(tr("Locate the directory of current note")); + tr("Locate To Folder"), this); + m_locateAct->setToolTip(tr("Locate the folder of current note")); connect(m_locateAct, &QAction::triggered, this, &VEditWindow::handleLocateAct);