Skip to content

Releases: hexojs/hexo-util

2.3.0

10 Aug 04:03
b34456a
Compare
Choose a tag to compare

Changes

  • feat(highlight): support 'tab' & 'mark' when wrap is disabled @curbengh [#225]

    • Previously tab and mark options were only availble when wrap is enabled, now they are also available even when wrap is 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 %}
  • ci: drop appveyor @curbengh [#224]

  • docs(spawn): link to upstream docs @curbengh [#223]

2.2.0

24 Jul 06:58
f4abd47
Compare
Choose a tag to compare

Features

  • perf(cache): Use faster Map instead 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);
    });
  • fix(highlight): support caption when wrap is disabled @curbengh [#210]

    # _config.yml
    highlight:
      wrap: false
    ```js caption
    const hi = 'bob'
    ```

Housekeeping

Dependencies

  • chore(deps-dev): bump mocha from 7.2.0 to 8.0.1 [#211]
  • chore(deps-dev): bump eslint from 6.8.0 to 7.0.0 [#207]

1.9.1

13 May 13:25
9346983
Compare
Choose a tag to compare

Fix

2.1.0

02 May 06:58
d08cd68
Compare
Choose a tag to compare

Breaking change

Refactor

2.0.0

27 Apr 01:37
f90fd44
Compare
Choose a tag to compare

Breaking change

Fix

Misc

Dependencies

1.9.0

07 Mar 17:06
595aaab
Compare
Choose a tag to compare

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

Refactor

Dependencies

  • chore(deps-dev): bump mocha from 6.2.2 to 7.0.0 (#173)

1.8.1

24 Dec 11:30
c876271
Compare
Choose a tag to compare

Fixes

  • tocObj() can parse headings without id attribute or anchor link. The value for id: key would simply be null. [#166]

1.8.0

19 Dec 10:52
a0c424f
Compare
Choose a tag to compare

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]

1.7.0

10 Dec 11:53
0d2b0e8
Compare
Choose a tag to compare

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 .html or index.html from a url string
    • Typically used for SEO, particularly to create canonical url

Fixes

  • wrap: option is no longer disabled when hljs: is enabled in code highlight highlight() utility (#138)
    • Since wrap: is enabled by default, if you prefer previous behavior of hljs:, you need to specifically disable wrap:,
    _config.yml
    highlight:
      wrap: false
      hljs: true
  • 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

1.6.1

29 Nov 00:29
ea43fba
Compare
Choose a tag to compare

Fix