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
Why does the html obtained in buildEnd contain ​ #3364
Comments
That's an HTML entity. Use some parser library to convert that to unicode sequences (like |
@brc-dd Of course I could have deleted them anyway, just wanted to make sure it was something viteprees expected or if it was a bug. |
It's expected behavior. We need something there to pass a11y tests. |
@brc-dd By the way, when generating rss, if it contains pictures, the image link in html obtained in buildEnd is not the final link, such as cover.A4Q5uAxl.jpg Is there a solution to this problem? Maybe I need to scan the dist to get the final html after actually writing the file? |
Can you elaborate? |
updated ⬆️ |
Ah weird. This should be the final link in buildEnd. I'll take a look. |
Ah no, you're using createContentLoader. It doesn't return SSR'd HTML. You need to create a list and store data from transformHtml and generate the feed from that in buildEnd. It should be something like this - #520 (comment) (first argument of |
Thank you, I solved it. In the end, I divided the html into those with pictures and without pictures. If there were pictures, I used node-html-parser to re-parse. Otherwise, I used the html in ContentData directly. (most do not come with pictures) |
Yeah that could work too. Or if you can, try to store images in the public directory. That way their path won't change. |
Yes, I noticed that the vue official blog does this. But for my scenario, I need to execute multiple processes from local markdown source files, vitepress is just one of them (building the website), and I need the markdown file to be just a normal file reference. By the way, I also submitted a PR for vue blog to fix the original problem of this issue. ref: vuejs/blog#21 |
Ah I don’t have access to the blog repo. Someone else will get back to you on that PR. |
Describe the bug
I am trying to generate rss for the website added by vitepress, but I found that the html obtained by getting
ContentData['html']
inbuildEnd
contains​
. I want to confirm that this is a mistake or it can be designed. .Reproduction
https://stackblitz.com/edit/vitepress-rss-generate?file=docs%2F.vitepress%2Fconfig.ts&file=docs%2F.vitepress%2Fdist%2Findex.html
Expected behavior
The html obtained in buildEnd does not contain the same as the final output html.
System Info
Additional context
I also confirmed that the RSS of vue’s official blog has this problem when displayed on inoreader and feedly.
Validations
The text was updated successfully, but these errors were encountered: