Skip to content

Commit

Permalink
build(deps): bump marked from 0.3.1 to 2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] authored and ryuran committed Mar 3, 2021
1 parent 0a03953 commit 69a118e
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docs/etc.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ surround your code in a code fence, and it will be highlighted via
``` html
<p>See this code:</p>

<pre class="sg-lang-javascript">
<pre class="sg-language-javascript">
$(<span class='hljs-function'>function</span>() {
alert(<span class='hljs-string'>"hello"</span>);
});
Expand Down
6 changes: 3 additions & 3 deletions examples/basic/index.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<!doctype html>
<html class="sg">

<head>
<meta charset="utf-8">
<title>Styledown</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="../../data/styledown.css">
<script src="../../data/styledown.js"></script>
</head>

<body class="sg">
<div class="styleguide">
<div>
Expand Down Expand Up @@ -47,7 +47,7 @@ <h2 id="javascript" class="sg">JavaScript</h2>
<div class="sg-text">
<h3 id="jquery" class="sg">jQuery</h3>
<p class="sg">This is an example with jQuery:</p>
</div><pre class="sg sg-lang-javascript sg-code"><span class="hljs-keyword">var</span> Foo = {
</div><pre class="sg sg-language-javascript sg-code"><span class="hljs-keyword">var</span> Foo = {
start: <span class="hljs-function"><span class="hljs-keyword">function</span><span class="hljs-params">()</span> </span>{
<span class="hljs-comment">/* do things */</span>;
alert(<span class="hljs-string">&quot;Hi&quot;</span>, <span class="hljs-number">2</span>);
Expand Down
4 changes: 2 additions & 2 deletions lib/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ exports.unpackExample = function (parent, pre, highlight, filePath) {
parent.remove()
} else {
klass = parent.find('code').attr('class')
let m = klass.match(/lang-([a-z]+)/)
let m = klass.match(/language-([a-z]+)/)

if (m) {
/* eslint-disable-next-line prefer-destructuring */
let lang = m[1]
parent.html(Hljs.highlight(lang, parent.text()).value)
parent.addClass(pre(`lang-${lang}`))
parent.addClass(pre(`language-${lang}`))
parent.addClass(pre('code'))
}
}
Expand Down
8 changes: 5 additions & 3 deletions lib/mdconf.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,18 @@ module.exports = function(str, options){
let keys = []
let depth = 0

toks.forEach(function(tok){
toks.forEach((tok) => {
switch (tok.type) {
case 'heading':
while (depth-- >= tok.depth) keys.pop()
keys.push(normalize(tok.text))
/* eslint-disable-next-line prefer-destructuring */
depth = tok.depth
break
case 'list_item_start':
case 'list_item_end':
case 'list':
tok.items.forEach((item) => {
put(conf, keys, item.text, normalize)
})
break
case 'text':
put(conf, keys, tok.text, normalize)
Expand Down
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function parseTags(str) {

function prefixClass(klass, prefix) {
return klass.split(' ').map(function (n) {
return n.length > 0 ? (`${prefix }-${ n}`) : n
return n.length > 0 ? (`${prefix}-${n}`) : n
}).join(' ')
}

Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"cheerio": "^0.22.0",
"highlight.js": "^10.6.0",
"js-beautify": "^1.13.5",
"marked": "^0.3.0",
"marked": "^2.0.1",
"mdextract": "^1.0.0",
"minimist": "^1.2.0",
"prettier": "^2.2.1",
Expand Down
2 changes: 1 addition & 1 deletion test/prefix.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('Prefix', function() {
expect(this.$('.styleguide-block')).have.length(1)
})
})
describe('inline options', function() {
describe('inline options', function() {
beforeEach(function() {
this.load("## Hello\n### world\nthere\n\n# Styleguide options\n\n* prefix: styleguide", {
head: ''
Expand Down
2 changes: 1 addition & 1 deletion test/syntax.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('Syntax highlight', function() {
expect(this.$).have.selector('pre .hljs-name')
})
it('set correct pre class', function() {
expect(this.$).have.selector('pre.sg-lang-html')
expect(this.$).have.selector('pre.sg-language-html')
})
})
describe('examples', function() {
Expand Down

0 comments on commit 69a118e

Please sign in to comment.