Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: upgrade katex to support upperrightarrow with complex expressions #36

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
bundle.js
.idea
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.5.1/katex.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.13.13/katex.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/github-markdown-css/2.2.1/github-markdown.css"/>
<style>
#input {
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@
"author": "[email protected]",
"license": "MIT",
"dependencies": {
"katex": "^0.6.0"
"katex": "^0.13.13"
},
"devDependencies": {
"markdown-it": "^6.0.0",
"markdown-it-testgen": "^0.1.4",
"tape": "^4.5.1"
"markdown-it": "^12.2.0",
"markdown-it-testgen": "^0.1.6",
"tape": "^4.5.1",
"watchify": "^4.0.0"
}
}
11 changes: 6 additions & 5 deletions test/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,22 @@ var path = require('path'),
var md = require('markdown-it')()
.use(mdk);

const { toPrintedString } = require('./helpers');

/* this uses the markdown-it-testgen module to automatically generate tests
based on an easy to read text file
*/
testLoad(path.join(__dirname, 'fixtures/default.txt'), function(data){
data.fixtures.forEach(function (fixture){
testLoad(path.join(__dirname, 'fixtures/default.txt'), function (data) {
data.fixtures.forEach(function (fixture) {

/* generic test definition code using tape */
tape(fixture.header, function(t){
tape(fixture.header, function (t) {
t.plan(1);

var expected = fixture.second.text,
actual = md.render(fixture.first.text);

t.equals(actual, expected);

t.equals(toPrintedString(actual), expected);
});

});
Expand Down
62 changes: 38 additions & 24 deletions test/fixtures/default.txt

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions test/helpers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const specialChars = [Buffer.from("e2808b", "hex").toString()];

exports.toPrintedString = s => specialChars.reduce((prev, next)=> prev.replace(new RegExp(next, 'g'), ''), s);
Loading