Skip to content

Commit

Permalink
(chore) remove HTML auto-merging
Browse files Browse the repository at this point in the history
Related #2889.
  • Loading branch information
joshgoebel committed Apr 5, 2021
1 parent c3fa28a commit 8f11501
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 215 deletions.
5 changes: 4 additions & 1 deletion VERSION_11_UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

- remove apache, http, nginx, properties, coffeescript from :common #2848

### Feature Removal

- HTML merging is now no longer included in core. You'll want to use a plugin instead. https://github.com/highlightjs/highlight.js/issues/2889
- fixMarkup is gone now, provide your own replacement #2534

### Behavior changes

Expand All @@ -26,7 +30,6 @@
## API's changed

- rename second_best to secondBest (highlightAuto)
- fixMarkup is gone now, provide your own replacement #2534
- highlightElement/highlightBlock result now no longer returns `re` key, use `relevance` instead
- `CSS_NUMBER_MODE` has now been moved into the internal `css-shared` library

Expand Down
3 changes: 0 additions & 3 deletions src/highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import * as MODES from './lib/modes.js';
import { compileLanguage } from './lib/mode_compiler.js';
import * as packageJSON from '../package.json';
import { BuildVuePlugin } from "./plugins/vue.js";
import { mergeHTMLPlugin } from "./plugins/merge_html.js";
import * as logger from "./lib/logger.js";

const escape = utils.escapeHTML;
Expand Down Expand Up @@ -958,8 +957,6 @@ const HLJS = function(hljs) {
// merge all the modes/regexs into our main object
Object.assign(hljs, MODES);

// built-in plugins, likely to be moved out of core in the future
hljs.addPlugin(mergeHTMLPlugin);
return hljs;
};

Expand Down
156 changes: 0 additions & 156 deletions src/plugins/merge_html.js

This file was deleted.

10 changes: 0 additions & 10 deletions test/browser/plain.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@

const {newTestCase, defaultCase, buildFakeDOM } = require('./test_case')

describe('browser with html with quotes in attributes', function() {
it('should property escape all quotes',
newTestCase({
code: "const oops = pick(employee, <span data-title=\" Type '&quot;height&quot;' is not assignable to type '&quot;name&quot; | &quot;age'&quot; | &quot;profession&quot;'.\">['name', 'height']</span>)\n",
language: "javascript",
expect: `<span class="hljs-keyword">const</span> oops = pick(employee, <span data-title=" Type '&quot;height&quot;' is not assignable to type '&quot;name&quot; | &quot;age'&quot; | &quot;profession&quot;'.">[<span class="hljs-string">'name'</span>, <span class="hljs-string">'height'</span>]</span>)\n`
}).runner
);
})

describe('plain browser', function() {

it('should return relevance key', async function() {
Expand Down
1 change: 0 additions & 1 deletion test/fixtures/expect/brInPre.txt

This file was deleted.

3 changes: 0 additions & 3 deletions test/fixtures/expect/custommarkup.txt

This file was deleted.

14 changes: 0 additions & 14 deletions test/fixtures/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,6 @@

</div>

<div id="custom-markup">

<!-- custom markup -->
<pre><code class="html">&lt;<a href="http://dev.w3.org/html5/spec/Overview.html#the-div-element">div</a> id="contents"&gt;
<del>&lt;p&gt;Hello, World!</del><!-- A comment should not break merging --><ins>Goodbye, cruel world!</ins>
&lt;/div&gt;
</code></pre>

<!-- <br> inside of <pre>s -->
<pre><code class="language-javascript">&gt;&gt; '\x41\x42\x43'<br>'ABC'<br><hr><br>&gt;&gt; '\x61\x62\x63'<br>'abc'
</code></pre>

</div>

<div id="language-alias">

<!-- language alias -->
Expand Down
26 changes: 0 additions & 26 deletions test/special/customMarkup.js

This file was deleted.

1 change: 0 additions & 1 deletion test/special/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ describe('special cases tests', () => {
});

require('./explicitLanguage');
require('./customMarkup');
require('./languageAlias');
require('./noHighlight');
require('./subLanguages');
Expand Down

0 comments on commit 8f11501

Please sign in to comment.