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

Remove beautifier #1404

Merged
merged 3 commits into from Oct 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 0 additions & 5 deletions js/profile-w3c-common.js
Expand Up @@ -13,13 +13,8 @@ require.config({
highlight: {
exports: "hljs",
},
beautify: {
exports: "beautify",
},
},
paths: {
"beautify-css": "deps/beautify-css",
"beautify-html": "deps/beautify-html",
"handlebars.runtime": "deps/handlebars",
"deps/highlight": "https://www.w3.org/Tools/respec/respec-highlight",
},
Expand Down
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -31,7 +31,6 @@
"jasmine-core": "^2.8.0",
"jasmine-reporters": "^2.2.1",
"jquery": "^3.2.1",
"js-beautify": "^1.7.4",
"karma": "^1.7.1",
"karma-chrome-launcher": "^2.2.0",
"karma-detect-browsers": "^2.2.5",
Expand Down
14 changes: 0 additions & 14 deletions src/core/beautify-options.js

This file was deleted.

10 changes: 1 addition & 9 deletions src/core/markdown.js
Expand Up @@ -43,8 +43,6 @@
* The whitespace of pre elements are left alone.
**/

import beautify from "deps/beautify-html";
import { beautifyOps } from "core/beautify-options";
import { markdownToHtml } from "core/utils";
export const name = "core/markdown";

Expand Down Expand Up @@ -214,13 +212,7 @@ export function run(conf, doc, cb) {
const cleanHTML = newBody.innerHTML
// Markdown parsing sometimes inserts empty p tags
.replace(/<p>\s*<\/p>/gm, "");
const beautifulHTML = beautify
.html_beautify(cleanHTML, beautifyOps)
// beautifer has a bad time with "\n&quot;<element"
// https://github.com/beautify-web/js-beautify/issues/943
.replace(/&quot;\n\s+\</gm, '"<');

newBody.innerHTML = beautifulHTML;
newBody.innerHTML = cleanHTML;
// Remove links where class .nolinks
substituteWithTextNodes(newBody.querySelectorAll(".nolinks a[href]"));
// Restructure the document properly
Expand Down