Skip to content

Commit 76164aa

Browse files
committed
(chore) remove HTML auto-merging
Related highlightjs#2889.
1 parent aa5a3e7 commit 76164aa

File tree

8 files changed

+4
-205
lines changed

8 files changed

+4
-205
lines changed

VERSION_11_UPGRADE.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

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

5+
### Feature Removal
6+
7+
- 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
8+
- fixMarkup is gone now, provide your own replacement #2534
59

610
### Behavior changes
711

@@ -26,7 +30,6 @@
2630
## API's changed
2731

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

src/highlight.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import * as MODES from './lib/modes.js';
1313
import { compileLanguage } from './lib/mode_compiler.js';
1414
import * as packageJSON from '../package.json';
1515
import { BuildVuePlugin } from "./plugins/vue.js";
16-
import { mergeHTMLPlugin } from "./plugins/merge_html.js";
1716
import * as logger from "./lib/logger.js";
1817

1918
const escape = utils.escapeHTML;
@@ -918,8 +917,6 @@ const HLJS = function(hljs) {
918917
// merge all the modes/regexs into our main object
919918
Object.assign(hljs, MODES);
920919

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

src/plugins/merge_html.js

Lines changed: 0 additions & 156 deletions
This file was deleted.

test/fixtures/expect/brInPre.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/fixtures/expect/custommarkup.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

test/fixtures/index.html

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,6 @@
3131

3232
</div>
3333

34-
<div id="custom-markup">
35-
36-
<!-- custom markup -->
37-
<pre><code class="html">&lt;<a href="http://dev.w3.org/html5/spec/Overview.html#the-div-element">div</a> id="contents"&gt;
38-
<del>&lt;p&gt;Hello, World!</del><!-- A comment should not break merging --><ins>Goodbye, cruel world!</ins>
39-
&lt;/div&gt;
40-
</code></pre>
41-
42-
<!-- <br> inside of <pre>s -->
43-
<pre><code class="language-javascript">&gt;&gt; '\x41\x42\x43'<br>'ABC'<br><hr><br>&gt;&gt; '\x61\x62\x63'<br>'abc'
44-
</code></pre>
45-
46-
</div>
47-
4834
<div id="language-alias">
4935

5036
<!-- language alias -->

test/special/customMarkup.js

Lines changed: 0 additions & 26 deletions
This file was deleted.

test/special/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ describe('special cases tests', () => {
3232
});
3333

3434
require('./explicitLanguage');
35-
require('./customMarkup');
3635
require('./languageAlias');
3736
require('./noHighlight');
3837
require('./subLanguages');

0 commit comments

Comments
 (0)