Update dependencies

This commit is contained in:
Tom MacWright
2016-07-19 16:20:11 -04:00
parent 91e7e42213
commit febfa13608
4 changed files with 23 additions and 23 deletions

View File

@ -21,7 +21,7 @@
"no-redeclare": [2],
"no-trailing-spaces": [2],
"no-undef": [2],
"no-underscore-dangle": [0],
"no-underscore-dangle": [2],
"no-unused-vars": [2],
"no-use-before-define": [0],
"quotes": [2, "single", {"allowTemplateLiterals": true}],
@ -29,8 +29,8 @@
"react/jsx-no-bind": 2,
"react/jsx-no-duplicate-props": 2,
"react/jsx-no-undef": 2,
"react/jsx-uses-react": 2,
"react/jsx-uses-vars": 2,
"react/jsx-uses-react": 2,
"react/react-in-jsx-scope": 2,
"react/no-unknown-property": [2],
"react/prop-types": 2,
@ -38,6 +38,10 @@
"react/self-closing-comp": [2],
"react/wrap-multilines": [2],
"semi": [2, "always"],
"keyword-spacing": [2, { "before": true, "after": true }],
"space-before-blocks": 2,
"space-before-function-paren": [2, "never"],
"space-in-parens": [2, "never"],
"strict": [0],
"valid-typeof": 2
}

View File

@ -34,7 +34,7 @@
"browserify": "^13.0.0",
"cssnano": "^3.4.0",
"es6-promise": "^3.0.2",
"eslint": "^2.9.0",
"eslint": "^3.1.1",
"eslint-plugin-babel": "^3.0.0",
"eslint-plugin-react": "^5.1.1",
"github-slugger": "^1.0.1",
@ -45,8 +45,8 @@
"react": "^15.0.2",
"react-dom": "^15.0.2",
"react-pure-render": "^1.0.2",
"remark": "^4.2.2",
"remark-html": "^3.0.0",
"remark": "^5.0.1",
"remark-html": "^5.0.0",
"remark-slug": "^4.1.0",
"unist-util-select": "^1.3.0",
"unist-util-visit": "^1.0.0"

View File

@ -1,14 +1,22 @@
import visit from 'unist-util-visit';
import hljs from 'highlight.js/lib/highlight';
import xml from 'highlight.js/lib/languages/xml';
import python from 'highlight.js/lib/languages/python';
import javascript from 'highlight.js/lib/languages/javascript';
import json from 'highlight.js/lib/languages/json';
import java from 'highlight.js/lib/languages/java';
import objectivec from 'highlight.js/lib/languages/objectivec';
import swift from 'highlight.js/lib/languages/swift';
import bash from 'highlight.js/lib/languages/bash';
hljs.registerLanguage('python', python);
hljs.registerLanguage('xml', xml);
hljs.registerLanguage('javascript', javascript);
hljs.registerLanguage('json', json);
hljs.registerLanguage('objc', objectivec);
hljs.registerLanguage('swift', swift);
hljs.registerLanguage('java', java);
hljs.registerLanguage('bash', bash);
/**
@ -17,22 +25,10 @@ hljs.registerLanguage('bash', bash);
*/
export default function attacher() {
function visitor(node) {
if (!node.lang) {
return;
if (node.lang) {
node.type = 'html';
node.value = `<pre class='hljs'>${hljs.highlightAuto(node.value, [node.lang]).value}</pre>`;
}
let data = node.data;
if (!data) {
node.data = data = {};
}
data.htmlContent = hljs.highlightAuto(node.value, [node.lang]).value;
data.htmlAttributes = data.htmlAttributes || {};
data.htmlAttributes.class = [
'hljs',
data.htmlAttributes.class
].filter(Boolean).join(' ');
}
return ast => visit(ast, 'code', visitor);

View File

@ -34,7 +34,7 @@ function extractSections(ast) {
var slugs = {};
describe('global rules', () => {
var ast = remark.parse(allPages);
var ast = remark().parse(allPages);
var seen = {};
/**
* Check that titles are unique. This is to ensure that permalinks
@ -58,7 +58,7 @@ describe('content', () => {
fs.readdirSync('./content').forEach(function(file) {
describe(file, () => {
var content = fs.readFileSync('./content/' + file, 'utf8');
var ast = remark.parse(content);
var ast = remark().parse(content);
it('links are valid', function() {
visit(ast, 'link', node => {