Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • M MathJax
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 304
    • Issues 304
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 15
    • Merge requests 15
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • MathJax
  • MathJax
  • Merge requests
  • !1961

Make tex2jax and asciimath2jax rescan after unmatched delimiter. #1960

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Davide P. Cervone requested to merge github/fork/dpvc/issue1960 into develop 7 years ago
  • Overview 1
  • Commits 1
  • Pipelines 0
  • Changes 2

Make tex2jax and asciimath2jax go back and rescan if an opening delimiter is not matched. Resolves issue #1960 (closed).

Compare
  • develop (base)

and
  • latest version
    29500164
    1 commit, 2 years ago

2 files
+ 14
- 6

    Preferences

    File browser
    Compare changes
unpacked/‎extensions‎
asciimat‎h2jax.js‎ +7 -3
tex2j‎ax.js‎ +7 -3
unpacked/extensions/asciimath2jax.js
+ 7
- 3
  • View file @ 29500164

  • Edit in single-file editor

  • Open in Web IDE


@@ -126,19 +126,23 @@ MathJax.Extension.asciimath2jax = {
@@ -126,19 +126,23 @@ MathJax.Extension.asciimath2jax = {
}
}
},
},
scanText: function (element) {
scanText: function (element,pos) {
if (element.nodeValue.replace(/\s+/,'') == '') {return element}
if (element.nodeValue.replace(/\s+/,'') == '') {return element}
var match, prev;
var match, prev;
this.search = {start: true};
this.search = {start: true};
this.pattern = this.start;
this.pattern = this.start;
while (element) {
while (element) {
this.pattern.lastIndex = 0;
this.pattern.lastIndex = pos || 0;
while (element && element.nodeName.toLowerCase() === '#text' &&
while (element && element.nodeName.toLowerCase() === '#text' &&
(match = this.pattern.exec(element.nodeValue))) {
(match = this.pattern.exec(element.nodeValue))) {
if (this.search.start) {element = this.startMatch(match,element)}
if (this.search.start) {element = this.startMatch(match,element)}
else {element = this.endMatch(match,element)}
else {element = this.endMatch(match,element)}
}
}
if (this.search.matched) {element = this.encloseMath(element)}
if (this.search.matched) {
 
element = this.encloseMath(element);
 
} else if (!this.search.start) {
 
element = this.scanText(this.search.open, this.search.opos + this.search.olen);
 
}
if (element) {
if (element) {
do {prev = element; element = element.nextSibling}
do {prev = element; element = element.nextSibling}
while (element && this.ignoreTags[element.nodeName.toLowerCase()] != null);
while (element && this.ignoreTags[element.nodeName.toLowerCase()] != null);
unpacked/extensions/tex2jax.js
+ 7
- 3
  • View file @ 29500164

  • Edit in single-file editor

  • Open in Web IDE


@@ -154,19 +154,23 @@ MathJax.Extension.tex2jax = {
@@ -154,19 +154,23 @@ MathJax.Extension.tex2jax = {
}
}
},
},
scanText: function (element) {
scanText: function (element,pos) {
if (element.nodeValue.replace(/\s+/,'') == '') {return element}
if (element.nodeValue.replace(/\s+/,'') == '') {return element}
var match, prev;
var match, prev;
this.search = {start: true};
this.search = {start: true};
this.pattern = this.start;
this.pattern = this.start;
while (element) {
while (element) {
this.pattern.lastIndex = 0;
this.pattern.lastIndex = pos || 0;
while (element && element.nodeName.toLowerCase() === '#text' &&
while (element && element.nodeName.toLowerCase() === '#text' &&
(match = this.pattern.exec(element.nodeValue))) {
(match = this.pattern.exec(element.nodeValue))) {
if (this.search.start) {element = this.startMatch(match,element)}
if (this.search.start) {element = this.startMatch(match,element)}
else {element = this.endMatch(match,element)}
else {element = this.endMatch(match,element)}
}
}
if (this.search.matched) {element = this.encloseMath(element)}
if (this.search.matched) {
 
element = this.encloseMath(element);
 
} else if (!this.search.start) {
 
element = this.scanText(this.search.open, this.search.opos + this.search.olen);
 
}
if (element) {
if (element) {
do {prev = element; element = element.nextSibling}
do {prev = element; element = element.nextSibling}
while (element && this.ignoreTags[element.nodeName.toLowerCase()] != null);
while (element && this.ignoreTags[element.nodeName.toLowerCase()] != null);
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
0
None
0
None
    Assign labels
  • Manage project labels

Milestone
MathJax v2.7.4
MathJax v2.7.4
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
2
2 participants
Administrator
Davide P. Cervone
Reference: mathjax/MathJax!1961
Source branch: github/fork/dpvc/issue1960

Menu

Explore Projects Groups Snippets