Skip to content

Commit

Permalink
Fixed the loading of the hyphenopoly language patterns (#163) (#164)
Browse files Browse the repository at this point in the history
* Fixed the loading of the hyphenopoly language patterns, which did not work when using percollate programmatically. (#163)

* Update hyphenopoly after it updated the language loadaing behavior. #163
mnater/Hyphenopoly#207
yashha authored Nov 25, 2023
1 parent 1ed9833 commit 07516c8
Showing 3 changed files with 11 additions and 16 deletions.
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
"hast-util-from-dom": "^4.2.0",
"hast-util-to-mdast": "^9.0.0",
"html-encoding-sniffer": "^3.0.0",
"hyphenopoly": "^5.1.0",
"hyphenopoly": "^5.3.0",
"iso-639-3-to-1": "^1.0.0",
"jsdom": "^21.1.0",
"mdast-util-gfm": "^2.0.2",
9 changes: 2 additions & 7 deletions src/hyphenate.js
Original file line number Diff line number Diff line change
@@ -9,13 +9,8 @@ function getHypenatorByLang(lang) {
: DEFAULT_LANG;
return Hyphenator.config({
sync: true,
loaderSync: file => {
return readFileSync(
new URL(
`../node_modules/hyphenopoly/patterns/${file}`,
import.meta.url
)
);
loaderSync: (file, patDir) => {
return readFileSync(new URL(file, patDir));
},
require: [language],
defaultLanguage: DEFAULT_LANG,

0 comments on commit 07516c8

Please sign in to comment.