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

chore(test): refactor tests to use ESM syntax #2

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
fa6bfb3
(chore) Rename second_best to secondBest (highlightAuto)
joshgoebel Mar 17, 2021
24d1338
(chore) remove apache, http, nginx, properties, coffeescript from :co…
joshgoebel Mar 17, 2021
df5b85b
(chore) remove background from Schoolbook theme
joshgoebel Mar 17, 2021
fe312ea
(chore) remove c-like and htmlbars stubs
joshgoebel Mar 17, 2021
faf14e4
(chore) no more old `re` key, use `relevance`
joshgoebel Mar 17, 2021
81386f7
(chore) mention relevance can be a float now
joshgoebel Mar 17, 2021
95c8b89
(chore) remove extra php version aliases, use `php` instead
joshgoebel Mar 17, 2021
bfa4cdf
(chore) Remover useBR, fixMarkup, tabReplace features
joshgoebel Mar 17, 2021
9244262
(chore) rename regex.join to indicate it's internal
joshgoebel Mar 17, 2021
499ef71
(chore) move CSS_NUMBER_MODE -> css-shared
joshgoebel Mar 17, 2021
1e9f864
(chore) goodbye sql_more
joshgoebel Mar 17, 2021
af5a25b
(chore) default padding 1em, some CSS consistency
joshgoebel Mar 17, 2021
c10a0b9
(chore) older API defers to highlightAll() now
joshgoebel Mar 17, 2021
07b428f
(chore) remove HTML auto-merging
joshgoebel Mar 17, 2021
ed1a146
(chore) top, illegalBy, and emitter are not private
joshgoebel Mar 17, 2021
d9b6836
(chore) `freepascal`, `lazarus`, `lpr`, `lpm` aliases removed.
joshgoebel Mar 17, 2021
5d48c7e
(chore) bump deps
joshgoebel Mar 17, 2021
3fbf897
(chore) build a true monolith, not concat
joshgoebel Nov 14, 2020
b5b6196
add size stats when building browser
joshgoebel Mar 17, 2021
2895642
fixup: remove html auto-merging
joshgoebel Mar 17, 2021
2fd239f
fixup: build monolith
joshgoebel Mar 17, 2021
affd3a4
fixup: build monolith again
joshgoebel Mar 17, 2021
39f645b
chore(test): refactor tests to use ESM syntax
aduh95 Feb 15, 2021
6f37b42
fixup! chore(test): refactor tests to use ESM syntax
aduh95 Mar 17, 2021
2d8c9b7
fixup! chore(test): refactor tests to use ESM syntax
aduh95 Mar 18, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
47 changes: 47 additions & 0 deletions VERSION_11_UPGRADE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Default Build Changes

- 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

- `initHighlighting` and `initHighlightingOnLoad` call `highlightAll`
- Calling `highlightAll` over and over is not guarded against

### Grammar's removed or renamed

- remove the old htmlbars stub, use handlebars
- remove c-like, use c, cpp, or arduino
- removed `sql_more`, use `sql` instead

### Visual / Themeing / CSS Changes

- Default padding on `.hljs` is now 1em (up from 0.5em)
- schoolbook no longer has a custom lined background, it's solid now

### Alias Changes

- php3,4,5,6,etc... aliases removed, use php instead
- `zsh` removed, use `sh` instead
- `freepascal`, `lazarus`, `lpr`, `lpm` removed. Use `delphi` or add you own aliases back.

## API's changed

- rename second_best to secondBest (highlightAuto)
- 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
- `highlight()` result now renames some keys to mark them as private: `_top`, `_emitter`, and `_illegalBy`

### Configuration options removed/changed

- useBR gone, #2559
- tabReplace gone, #2874

## Others

- `relevance` returned may be a floating point number now
- regex utility `join` renamed to `_eitherRewriteBackreferences` (this was always internal)
19 changes: 4 additions & 15 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,7 @@ Returns an object with the following properties:
* ``language``: detected language
* ``relevance``: integer value representing the relevance score
* ``value``: HTML string with highlighting markup
* ``second_best``: object with the same structure for second-best heuristically detected language (may be absent)


``fixMarkup(value)`` (deprecated as of 10.3)
--------------------------------------------

**fixMarkup is deprecated and will be removed entirely in v11.**

Post-processing of the highlighted markup. Currently consists of replacing indentation TAB characters and using ``<br>`` tags instead of new-line characters. Options are set globally with ``configure``.

Accepts a string with the highlighted markup.
* ``secondBest``: object with the same structure for second-best heuristically detected language (may be absent)


``highlightBlock(block)``
Expand All @@ -73,8 +63,6 @@ in the ``class`` attribute of the DOM node. See the :doc:`class reference

Configures global options:

* ``tabReplace``: a string used to replace TAB characters in indentation.
* ``useBR``: a flag to generate ``<br>`` tags instead of new-line characters in the output, useful when code is marked up using a non-``<pre>`` container.
* ``classPrefix``: a string prefix added before class names in the generated markup, used for backwards compatibility with stylesheets.
* ``languages``: an array of language names and aliases restricting auto detection to only these languages.
* ``languageDetectRe``: a regex to configure how CSS class names map to language (allows class names like say `color-as-php` vs the default of `language-php`, etc.)
Expand All @@ -84,11 +72,12 @@ Accepts an object representing options with the values to updated. Other options
::

hljs.configure({
tabReplace: ' ', // 4 spaces
noHighlightRe: /^do-not-highlightme$/i,
languageDetectRe: /\bgrammar-([\w-]+)\b/i, // for `grammar-swift` style CSS naming
classPrefix: '' // don't append class prefix
// … other options aren't changed
});
hljs.initHighlighting();
hljs.highlightAll();


``highlightAll()``
Expand Down
11 changes: 0 additions & 11 deletions docs/style-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,6 @@ Okay to use:
These may seem arbitrary at first but it's what has shown to make sense in
practice.

There's also a common set of rules that *has* to be defined for the root
container verbatim:

::

.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
}


``.subst``
----------
Expand Down
Loading