summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--public/js/extra.js6
-rw-r--r--public/js/index.js1
-rw-r--r--public/vendor/md-toc.js8
-rw-r--r--public/views/index/body.ejs6
-rw-r--r--public/views/slide.ejs6
5 files changed, 15 insertions, 12 deletions
diff --git a/public/js/extra.js b/public/js/extra.js
index ed1470be..76e95635 100644
--- a/public/js/extra.js
+++ b/public/js/extra.js
@@ -846,11 +846,13 @@ const linkifyAnchors = (level, containingElement) => {
let header = headers[i]
if (header.getElementsByClassName('anchor').length === 0) {
if (typeof header.id === 'undefined' || header.id === '') {
- // to escape characters not allow in css and humanize
+ // to escape characters not allow in css and humanize
const id = slugifyWithUTF8(getHeaderContent(header))
header.id = id
}
- header.insertBefore(anchorForId(header.id), header.firstChild)
+ if (!(typeof header.id === 'undefined' || header.id === '')) {
+ header.insertBefore(anchorForId(header.id), header.firstChild)
+ }
}
}
}
diff --git a/public/js/index.js b/public/js/index.js
index 0c575961..c2969e92 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -2788,6 +2788,7 @@ function updateViewInner () {
renderTOC(ui.area.markdown)
generateToc('ui-toc')
generateToc('ui-toc-affix')
+ autoLinkify(ui.area.markdown)
generateScrollspy()
updateScrollspy()
smoothHashScroll()
diff --git a/public/vendor/md-toc.js b/public/vendor/md-toc.js
index 876978f7..59e75aed 100644
--- a/public/vendor/md-toc.js
+++ b/public/vendor/md-toc.js
@@ -44,7 +44,7 @@
}
}
- Toc.prototype._createTocContent = function recursiveToc(level = 0, titleElements = [], titleNames = [], ulClass = undefined) {
+ Toc.prototype._createTocContent = function recursiveToc(level = 0, titleElements = [], titleNames = [], ulClass = undefined, index = 0) {
// Inititalize our elements from the toc object
// which is only available on level 0
if (level === 0) {
@@ -74,8 +74,8 @@
var elementText = (typeof this.process === 'function' ? this.process(element) : element.innerHTML).replace(/<(?:.|\n)*?>/gm, '')
var id = element.getAttribute('id')
if (!id) {
- element.setAttribute('id', 'tip' + i)
- id = '#tip' + i
+ element.setAttribute('id', 'tip' + ++index)
+ id = '#tip' + index
} else {
id = '#' + id
}
@@ -97,7 +97,7 @@
// This element is for the lower lever, we have to re-add it before we send the list down there.
titleElements.unshift(element)
// Let's call ourself and get to the next level
- content += recursiveToc(level + 1, titleElements, titleNames, ulClass)
+ content += recursiveToc(level + 1, titleElements, titleNames, ulClass, index)
} else {
// When we end up here, met a higher level element
// This is not our business so back into the list with the element and let's end this loop
diff --git a/public/views/index/body.ejs b/public/views/index/body.ejs
index 43582d78..a5e591ef 100644
--- a/public/views/index/body.ejs
+++ b/public/views/index/body.ejs
@@ -65,19 +65,19 @@
</span>
<div class="lead row" style="width: 90%; margin: 0 auto;">
<div class="col-md-4 inner">
- <a href="<%- serverURL %>/features#share-notes">
+ <a href="<%- serverURL %>/features#Share-Notes">
<i class="fa fa-bolt fa-3x"></i>
<h4><%= __('Collaborate with URL') %></h4>
</a>
</div>
<div class="col-md-4 inner">
- <a href="<%- serverURL %>/features#mathjax">
+ <a href="<%- serverURL %>/features#MathJax">
<i class="fa fa-bar-chart fa-3x"></i>
<h4><%= __('Support charts and MathJax') %></h4>
</a>
</div>
<div class="col-md-4 inner">
- <a href="<%- serverURL %>/features#slide-mode">
+ <a href="<%- serverURL %>/features#Slide-Modee">
<i class="fa fa-tv fa-3x"></i>
<h4><%= __('Support slide mode') %></h4>
</a>
diff --git a/public/views/slide.ejs b/public/views/slide.ejs
index 9b19af2a..bbdf5899 100644
--- a/public/views/slide.ejs
+++ b/public/views/slide.ejs
@@ -18,7 +18,7 @@
<% if(useCDN) { %>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fork-awesome/1.1.3/css/fork-awesome.min.css" integrity="sha256-ZhApazu+kejqTYhMF+1DzNKjIzP7KXu6AzyXcC1gMus=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ionicons/2.0.1/css/ionicons.min.css" integrity="sha256-3iu9jgsy9TpTwXKb7bNQzqWekRX7pPK+2OLj3R922fo=" crossorigin="anonymous" />
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.6.0/css/reveal.min.css" integrity="sha256-ol2N5Xr80jdDqxK0lte3orKGb9Ja3sOnpAUV7TTADmg=" crossorigin="anonymous" />
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.7.0/css/reveal.min.css" integrity="sha256-9+Wg2bcNeiOMGXOUNqBdceY2lAH/eCiTDcdzHhHIl48=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/emojify.js/1.1.0/css/basic/emojify.min.css" integrity="sha256-UOrvMOsSDSrW6szVLe8ZDZezBxh5IoIfgTwdNDgTjiU=" crossorigin="anonymous" />
<%- include build/slide-header %>
<%- include shared/polyfill %>
@@ -88,8 +88,8 @@
<script src="<%= serverURL %>/js/mathjax-config-extra.js"></script>
<% if(useCDN) { %>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.6.0/lib/js/head.min.js" integrity="sha256-+09kLhwACKXFPDvqo4xMMvi4+uXFsRZ2uYGbeN1U8sI=" crossorigin="anonymous"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.6.0/js/reveal.min.js" integrity="sha256-ixSKHrWAL2k0mqVSRju9+to2/uZSEK9+kJRfdNBolG8=" crossorigin="anonymous"></script>
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.7.0/lib/js/head.min.js" integrity="sha256-CTcwyen1cxIrm4hlqdxe0y7Hq6B0rpxAKLiXMD3dJv0=" crossorigin="anonymous"></script>
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.7.0/js/reveal.min.js" integrity="sha256-Xr6ZH+/kc7hDVReZLO5khBknteLqu5oen/xnSraXrVk=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/velocity/1.4.0/velocity.min.js" integrity="sha256-bhm0lgEt6ITaZCDzZpkr/VXVrLa5RP4u9v2AYsbzSUk=" crossorigin="anonymous" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js" integrity="sha256-jnOjDTXIPqall8M0MyTSt98JetJuZ7Yu+1Jm7hLTF7U=" crossorigin="anonymous" defer></script>