Releases: hexojs/hexo-util
Releases · hexojs/hexo-util
2.4.0
Breaking change
- fix(highlight): use
<div>when wrap is disabled @curbengh [#229]- when
wrapis disabled:
# _config.yml highlight: wrap: false # defaults to true
- previously, caption is rendered as:
<pre> <figcaption>caption</figcaption> <code></code> </pre>
- it's now rendered as:
<pre> <div class="caption">caption</div> <code></code> </pre>
- you can style it by:
pre div.caption { font-size: 0.9em; color: #888; } pre div.caption a { float: right; }
- when
Feature
2.3.0
Changes
-
feat(highlight): support 'tab' & 'mark' when wrap is disabled @curbengh [#225]
- Previously
tabandmarkoptions were only availble whenwrapis enabled, now they are also available even whenwrapis disabled. - Example:
# _config.yml highlight: tab_replace: ' ' wrap: false
{% codeblock lang:js mark:2,5 %} const input = [ { name: 'lorem', item: 'ipsum' }, { name: 'per', item: 'doming' }, { name: 'dolor', item: 'lorem' }, { name: 'usu', item: 'pericula' } ] {% endcodeblock %}
- Previously
-
docs(spawn): link to upstream docs @curbengh [#223]
spawn()is a nice wrapper aroundchild_process.spawn(), so it supports similar options.
2.2.0
Features
- perf(cache): Use faster
Mapinstead of Object. @SukkaW [#209] - feat(cache): cache#dump & cache#size @SukkaW [#209]
// Output number of key-value pairs cache.size(); // 3 // Outputs everything in cache cache.dump(); /* { foo: 'bar', baz: 123, qux: 456 } */
Fixes
-
Support string argument in
spawn()@curbengh [#220]- Previously
spawn()only supports array argument:
spawn('cat', ['test.txt']).then((content) => { console.log(content); });
- Now string argument is also valid:
spawn('cat', 'test.txt').then((content) => { console.log(content); });
- Previously
-
fix(highlight): support caption when wrap is disabled @curbengh [#210]
# _config.yml highlight: wrap: false
```js caption const hi = 'bob' ```
Housekeeping
- Drop Node 13 from CI @curbengh [#219]
- refactor(encode/decode_url): replace decodeURI with native querystring.unescape @curbengh [#214]
Dependencies
1.9.1
Fix
- Fix (backport from 2.0.0)
CacheStream()compatibility issue with Node 14 @curbengh (#205)
2.1.0
2.0.0
Breaking change
- Drop support of Node 8 @SukkaW (#191, #193)
- Requires
autoDetectto be enabled andlangto be unset to use sublanguagehighlight()@curbengh (#192, #196)
Fix
- Fix
CacheStream()compatibility issue with Node 14 @curbengh (#195)
Misc
- docs(isExternalLink): add JSDoc @yoshinorin (#190)
Dependencies
- chore(deps-dev): bump rewire from 4.0.1 to 5.0.0 @dependabot-preview (#187)
1.9.0
Features
- feat(prism): add data-language attribute @SukkaW (#177)
- feat(prism): add mark & firstLine option support @SukkaW (#172)
- feat: bring up prism highlight support @SukkaW (#168)
- Laying the groundwork for the planned support of prism highlight library in the upcoming Hexo v5, in addition to the current highlight.js library.
Fixes
- fix(is_external_link): handle invalid url @SukkaW (#183)
- fix(prism): add strip_indent support @SukkaW (#184)
- fix(tocObj): skip permalink symbol @curbengh (#175)
- Fix highlighting when hljs is enabled @ppwwyyxx (#171)
- fix(htmlTag): handle numeric values. @KentarouTakeda (#176)
Refactor
- refactor: optimize cache @SukkaW (#170)
- refactor(highlight): add strip-indent @SukkaW (#169)
- refactor(toc_obj): simplify the code @SukkaW (#181)
Dependencies
- chore(deps-dev): bump mocha from 6.2.2 to 7.0.0 (#173)
1.8.1
1.8.0
Features
tocObj()to convert headings (e.g.<h1>) in html into JSON format [#137]- Enables headings to be programmatically parsed and manipulated.
- Created mainly to be used by the
toc()helper (ref hexojs/hexo#3850).
Cache()class utility [#162]- Mainly to cache user config to avoid unnecessary parsing
- We have started utilizing caching on many utilities and resulted in up to 20% better performance.
Fixes
- In
htmlTag(), url in<meta>tags (in Facebook Open Graph and Twitter Card) are now percent-encoded, instead of html-escaped. [#159]- url in srcset attribute is now encoded using
encodeURL()which supports more url types, instead of encodeURI. [#160]
- url in srcset attribute is now encoded using
1.7.0
Features
deepMerge()utility (#141)- Based on deepmerge library
- target object is not modified, which is different to Object.assign() and lodash.merge
prettyUrls()utility (#152)- This is used to remove trailing
.htmlorindex.htmlfrom a url string - Typically used for SEO, particularly to create canonical url
- This is used to remove trailing
Fixes
wrap:option is no longer disabled whenhljs:is enabled in code highlighthighlight()utility (#138)- Since
wrap:is enabled by default, if you prefer previous behavior ofhljs:, you need to specifically disablewrap:,
_config.yml highlight: wrap: false hljs: true
- Since
url_for()&full_url_for()should ignore absolute url (i.e. links that start with "http" or double slash "//") (#147)- Selecting a codeblock should not include line number (#153)
- This reverts breaking change introduced in #132