Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regarding package "remark-ping". Cannot set properties of undefined (setting 'ping') #488

Closed
mambans opened this issue Apr 28, 2023 · 2 comments
Labels
status/duplicate This is "déjà vu" type/question This does not need any changes

Comments

@mambans
Copy link

mambans commented Apr 28, 2023

Hello, I'm wondering if anyone else have gotten this problem before? When I'm parsing the my html with "remark-ping" I get the following error "Cannot set properties of undefined (setting 'ping')".

const htmlTtext = <p><span class="mention" data-index="0" data-denotation-char="@" data-id="419" data-value="Robin Persson"><span contenteditable="false"><span class="ql-mention-denotation-char">@</span>Robin Persson</span></span> </p>;

export const htmlToMarkdown = () => {
	const file = remark()
		.use(rehypeParse, { emitParseErrors: true, duplicateAttribute: false })
		.use(rehypeRemark)
		.use(remarkPing, {
			pingUsername: (name) => true,
			userURL: (name) => https://your.website.com/path/to/${name},
		})
		.use(remarkStringify)
		.processSync(htmlText)
		.then((vfile) => {
			console.log("vfile:", vfile);
			return vfile;
		});

	return String(file);
};```

node: v18.7.0

"rehype-remark": "^9.1.2",
"remark": "^14.0.2",
"remark-html": "^15.0.2",
"remark-ping": "^2.3.1",
"remark-stringify": "^10.0.2",

		
![image](https://user-images.githubusercontent.com/23280380/235128608-14a778ea-e915-4136-a7ca-5745b843a186.png)
@StaloneLab
Copy link
Member

Hello, the version of remark you are using is too recent for our plugins (more like our plugins being too old for the current version of remark). Please see issue #416 , especially my latest message providing the key figures.

@mambans
Copy link
Author

mambans commented Apr 28, 2023

Ahh oke, thanks for the reply!

@StaloneLab StaloneLab added status/duplicate This is "déjà vu" type/question This does not need any changes labels Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/duplicate This is "déjà vu" type/question This does not need any changes
Projects
None yet
Development

No branches or pull requests

2 participants