Skip to content

Commit

Permalink
Merge pull request #14 from homer0/homer0_links
Browse files Browse the repository at this point in the history
Fix links with custom labels
  • Loading branch information
homer0 committed May 28, 2024
2 parents 5985736 + 1488813 commit 3f56adc
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/fns/splitText.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ const splitText = (text, length) => {
let result = R.compose(
R.addIndex(R.reduce)(get(reduceSentences)(length), ['']),
R.reduce(get(reduceWordsList), []),
R.split(/(?<!\{@\w+) /),
R.split(/(?<!\{@\w+[^}]*) /),
R.reduce(get(reduceText), ''),
)(lines);

Expand Down
21 changes: 21 additions & 0 deletions tests/e2e/fixtures/remarks-01.fixture.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ module.exports = {
*/
export function log(name = 'batman', logger) {}

/**
* @type {Object} RemarkWithLink
* @remarks
* Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec malesuada fermentum {@link SomethingElse} nibh, sed aliquet ante porta a. Nullam blandit posuere fringilla. Nullam vel risus vitae lectus luctus auctor a venenatis ante. In hac habitasse platea dictumst.
* @privateRemarks
* Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec xx {@link SomethingElse | something} nibh, sed aliquet ante porta a. Nullam blandit posuere fringilla. Nullam vel risus vitae lectus luctus auctor a venenatis ante. In hac habitasse platea dictumst.
*/

//# output

/**
Expand All @@ -47,3 +55,16 @@ export function log(name = 'batman', logger) {}
* vitae lectus luctus auctor a venenatis ante. In hac habitasse platea dictumst.
*/
export function log(name = 'batman', logger) {}

/**
* @type {Object} RemarkWithLink
* @remarks
* Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec malesuada fermentum
* {@link SomethingElse} nibh, sed aliquet ante porta a. Nullam blandit posuere fringilla. Nullam
* vel risus vitae lectus luctus auctor a venenatis ante. In hac habitasse platea dictumst.
* @privateRemarks
* Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec xx
* {@link SomethingElse | something} nibh, sed aliquet ante porta a. Nullam blandit posuere
* fringilla. Nullam vel risus vitae lectus luctus auctor a venenatis ante. In hac habitasse platea
* dictumst.
*/

0 comments on commit 3f56adc

Please sign in to comment.