rasendubi / uniorg

An accurate Org-mode parser for JavaScript/TypeScript
https://oleksii.shmalko.com/uniorg
GNU General Public License v3.0
263 stars 25 forks source link

fix(#57): fix whitespace entity parsing (\_<SPC>) #58

Closed rasendubi closed 1 year ago

rasendubi commented 1 year ago

The crash was caused by entity regex returning undefined for "brackets" group (because it only applies for value2 branch) and the code tried to backoff.

Fix by adding a guard against empty brackets group.

Fixes #57

codecov-commenter commented 1 year ago

Codecov Report

Merging #58 (7360d74) into master (4ea4753) will not change coverage. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master      #58   +/-   ##
=======================================
  Coverage   95.93%   95.93%           
=======================================
  Files          15       15           
  Lines        1622     1622           
  Branches      522      534   +12     
=======================================
  Hits         1556     1556           
  Misses         65       65           
  Partials        1        1           
Impacted Files Coverage Δ
packages/uniorg-parse/src/parser.ts 95.22% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more