retextjs / retext-syntax-urls Goto Github PK
View Code? Open in Web Editor NEWplugin to classify url-like values as syntax, not natural language
Home Page: https://unifiedjs.com
License: MIT License
plugin to classify url-like values as syntax, not natural language
Home Page: https://unifiedjs.com
License: MIT License
3.1.0
n/a
git clone [email protected]:IsaacScript/isaacscript.github.io.git
cd isaacscript.github.io.git
git checkout c7acddaaf2aa66dcc593040384f2a269894c0b8f
vim .remarkrc.mjs
Comment out the line that says .use(retextSyntaxURLs)
and save the file.
./lint.sh
Notice that it succeeds.
Now, uncomment out the retextSyntaxURLs line.
./lint.sh
Notice that it fails with the following error:
docs\converting-lua-code.md
1:1 error TypeError: Cannot read property 'type' of undefined
at mergeLinks (file:///D:/Repositories/isaacscript.github.io/node_modules/retext-syntax-urls/index.js:86:12)
at Object.iteratee (file:///D:/Repositories/isaacscript.github.io/node_modules/retext-syntax-urls/node_modules/unist-util-modify-children/index.js:48:12)
at arrayIterate (file:///D:/Repositories/isaacscript.github.io/node_modules/retext-syntax-urls/node_modules/array-iterate/index.js:37:25)
at Array.iterator (file:///D:/Repositories/isaacscript.github.io/node_modules/retext-syntax-urls/node_modules/unist-util-modify-children/index.js:37:5)
at Of.run (file:///D:/Repositories/isaacscript.github.io/node_modules/parse-latin/lib/index.js:46:23)
at Of.Constructor.<computed> [as tokenizeSentence] (file:///D:/Repositories/isaacscript.github.io/node_modules/parse-latin/lib/index.js:374:17)
at Of.parser (file:///D:/Repositories/isaacscript.github.io/node_modules/parse-latin/lib/parser.js:13:43)
at Of.Constructor.<computed> [as tokenizeParagraph] (file:///D:/Repositories/isaacscript.github.io/node_modules/parse-latin/lib/index.js:374:35)
at Of.parser (file:///D:/Repositories/isaacscript.github.io/node_modules/parse-latin/lib/parser.js:13:43)
at Of.Constructor.<computed> [as tokenizeRoot] (file:///D:/Repositories/isaacscript.github.io/node_modules/parse-latin/lib/index.js:374:35)
Separately, you can confirm that this is a regression in this specific package by setting "retext-syntax-mentions": "3.0.0",
in the package.json file, doing an npm install
, and then running ./lint.sh
, and observe that it succeeds (without commenting anything out).
It should not produce any errors.
It does produce an error.
Node v16
npm v7
Windows
Docusaurus
Very common in a README, I would think, to point the developer to a localhost URL.
Example: http://localhost:3000/home
Perhaps this is more of an issue with retext in general, but I am using it in the context of this package with retext-spell
:
https://github.com/tbroadley/spellchecker-cli
3.1.1
No response
The plugin fails to parse on-premise URL. Example:
import { unified } from "unified";
import retextEnglish from "retext-english";
import retextSyntaxUrls from "retext-syntax-urls";
import { visit } from 'unist-util-visit';
import { inspect } from 'unist-util-inspect';
const content = 'on-premise URL: https://CorporateIntranet/page.aspx'
const processor = unified()
.use(retextEnglish)
.use(retextSyntaxUrls);
const tree = processor.parse(content);
console.log(inspect(tree));
The source node should be: https://CorporateIntranet/page.aspx
The source node is: page.aspx
No response
No response
No response
No response
3.1.1
No response
import { unified } from "unified";
import retextEnglish from "retext-english";
import retextSyntaxUrls from "retext-syntax-urls";
import { visit } from 'unist-util-visit';
import { inspect } from 'unist-util-inspect';
const content = 'Incorrect source node (e.g. [email protected])'
const processor = unified()
.use(retextEnglish)
.use(retextSyntaxUrls);
const tree = processor.parse(content);
console.log(inspect(tree));
The bug is described below.
In addition, if I change the content to:
const content = '(e.g. [email protected])'
The library will give an exception saying that: 'TypeError: Cannot read properties of undefined (reading 'type')'
Source node is '[email protected]'.
Source nodes are: '(e.g' and '[email protected])'
No response
No response
No response
No response
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.