hfg-gmuend / openmoji.org

http://openmoji.org/
8 stars 4 forks source link

Unable to parse HTML; Element is missing end tag. #184

Closed s-light closed 8 months ago

s-light commented 10 months ago

trying to develop #182 but with a fresh clone i can not get it to run error free...

Unable to parse HTML; Element is missing end tag.
 at {"file":"/src/pages/library/[emoji].astro","line":207,"column":11}
205|      <div class="astro-FGZAU5TY">
206|            <h2 class="astro-FGZAU5TY"><a target="_blank" class="standardLink astro-FGZAU5TY" href="https://emojipedia.org/">Emojipedia</a> description:</h2>
207|            <p class="astro-FGZAU5TY">
   |            ^
208|              <p>A burning candle, as lit when taking a <a href="/person-taking-bath/">bath</a> or the power is out. Depicted as a white, pillar-shaped candle with 
209|              <a class="redlink astro-FGZAU5TY" target="_blank" href="https://emojipedia.org/candle">Read more</a>

traced down to https://github.com/hfg-gmuend/openmoji.org/blob/master/src/data/emojipediaData.json contains opening

tags in the description fields.

"1F56F": {
        "emoji": "πŸ•―οΈ",
        "codepoints": [
            "1F56F",
            "FE0F"
        ],
        "name": "Candle",
        "description": "<p>A burning candle, as lit when taking a <a href=\"/person-taking-bath/\">bath</a> or the power is out. Depicted as a white, pillar-shaped candle with ",
        "image": "https://em-content.zobj.net/thumbs/150/apple/354/candle_1f56f-fe0f.png",
        "permalink": "https://emojipedia.org/candle",
        "aliases": [],
// ...

it seems that is something the api is returning this way. at least i did not find some text-shortener in https://github.com/hfg-gmuend/openmoji.org/blob/master/get-emojipedia-data.js...

b-g commented 9 months ago

Can't reproduce this. Has it been resolved?

Screen Shot 2024-01-09 at 11 51 57
s-light commented 9 months ago

simmilar problem:

Unable to parse HTML; Element is missing end tag. at {"file":"/src/pages/library/[emoji].astro","line":207,"column":11} 205|

206|

Emojipedia description:

207|

| ^ 208|

Foggy weather displayed as fog covering a bridge or cityscape, depending on the platform. For platforms that Read more 209|

Error: Unable to parse HTML; Element is missing end tag. at {"file":"/src/pages/library/[emoji].astro","line":207,"column":11} 205|

206|

Emojipedia description:

207|

| ^ 208|

Foggy weather displayed as fog covering a bridge or cityscape, depending on the platform. For platforms that Read more 209|

at handleParseError (/home/stefan/mydata/github/openmoji.org/node_modules/vite/dist/node/chunks/dep-9c153816.js:21372:11) at traverseHtml (/home/stefan/mydata/github/openmoji.org/node_modules/vite/dist/node/chunks/dep-9c153816.js:21328:9) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async devHtmlHook (/home/stefan/mydata/github/openmoji.org/node_modules/vite/dist/node/chunks/dep-9c153816.js:53246:5) at async applyHtmlTransforms (/home/stefan/mydata/github/openmoji.org/node_modules/vite/dist/node/chunks/dep-9c153816.js:21725:21) at async render (file:///home/stefan/mydata/github/openmoji.org/node_modules/astro/dist/core/render/dev/index.js:84:15) at async ssr (file:///home/stefan/mydata/github/openmoji.org/node_modules/astro/dist/core/render/dev/index.js:94:12) at async handleRequest (file:///home/stefan/mydata/github/openmoji.org/node_modules/astro/dist/vite-plugin-astro-server/index.js:74:18)


and indead in the `openmoji.org/src/data/emojipediaData.json` file line 99802 i can find:
```json
"1F301": {
        "emoji": "🌁",
        "codepoints": [
            "1F301"
        ],
        "name": "Foggy",
        "description": "<p>Foggy weather displayed as&nbsp;<a href=\"/fog/\" title=\"🌫 Fog\">fog</a> covering a bridge or cityscape, depending on the platform. For platforms that",
        "image": "https://em-content.zobj.net/thumbs/150/apple/354/foggy_1f301.png",
        "permalink": "https://emojipedia.org/foggy",
        "aliases": [
            "Fog",
            "Foggy City",
            "FogΒ Bridge"
        ],
        "crossref": [
// ...
        ],
// ....
    },

and that contains a opening <p> but no closing one.

b-g commented 9 months ago

Can't reproduce. Sorry! Are you using the node version as in https://github.com/hfg-gmuend/openmoji.org/blob/master/.nvmrc? Or maybe an OS issue? (I'm on macOS)

Screen Shot 2024-01-12 at 10 38 08
s-light commented 9 months ago

version the point.

i have

$ npm --version
9.6.6
$ node --version
v18.17.1

(iam on kubuntu 23.10)

s-light commented 8 months ago

ok now installed nvm. and getting the same behavior still..

http://127.0.0.1:3000/library/emoji-1F301

stefan@stefan-Zen:~/mydata/github/openmoji.org (master $)$ npm -v
6.14.12
stefan@stefan-Zen:~/mydata/github/openmoji.org (master $)$ npm start

> openmoji.org@15.0.0 start /home/stefan/mydata/github/openmoji.org
> gulp copy-markdown-assets && node compress-json.mjs && astro dev

[11:09:22] Using gulpfile ~/mydata/github/openmoji.org/gulpfile.js
[11:09:22] Starting 'copy-markdown-assets'...
[11:09:22] Starting 'copy-markdown-samples-assets'...
[11:09:22] Finished 'copy-markdown-samples-assets' after 69 ms
[11:09:22] Starting 'copy-markdown-styleguide-assets'...
[11:09:22] Finished 'copy-markdown-styleguide-assets' after 47 ms
[11:09:22] Finished 'copy-markdown-assets' after 118 ms
JSON-file compressed
11:09 AM [astro] Server started                               885ms
11:09 AM [astro] Local: http://127.0.0.1:3000/
Rendering home page index.astro
Unescaped HTML content found inside expression!

The next minor version of Astro will automatically escape all
expression content. Please use the `set:html` directive.

Expression content:
proof of concept / Beta versions,<br />not intended for production use!
11:09 AM [routeCache] Internal Warning: getStaticPaths() called twice during the build. (src/pages/library/[emoji].astro)
index 0
01
{
  baseEmoji: {
    emoji: 'πŸ˜€',
    hexcode: '1F600',
    group: 'smileys-emotion',
    subgroups: 'face-smiling',
    annotation: 'grinning face',
    tags: 'face, grin',
    openmoji_tags: 'smile, happy',
    openmoji_author: 'Emily JΓ€ger',
    openmoji_date: '2018-04-18',
    skintone: '',
    skintone_combination: '',
    skintone_base_emoji: '',
    skintone_base_hexcode: '',
    unicode: 1,
    order: 1
  },
  skintones: [],
  skintone_combinations: []
}
Rendering page for emoji 🌁   1F301
Unescaped HTML content found inside expression!

The next minor version of Astro will automatically escape all
expression content. Please use the `set:html` directive.

Expression content:
<p>Foggy weather displayed as&nbsp;<a href="/fog/" title="🌫 Fog">fog</a> covering a bridge or cityscape, depending on the platform. For platforms that
Unescaped HTML content found inside expression!

The next minor version of Astro will automatically escape all
expression content. Please use the `set:html` directive.

Expression content:
<a href="/library/emoji-1F301" target="_blank" rel="noreferrer noopener" class="redlink">🌁</a>
11:09 AM [astro] 500 /library/emoji-1F301                     
Rendering page for emoji 🌁   1F301
Unescaped HTML content found inside expression!

The next minor version of Astro will automatically escape all
expression content. Please use the `set:html` directive.

Expression content:
proof of concept / Beta versions,<br />not intended for production use!
Unescaped HTML content found inside expression!

The next minor version of Astro will automatically escape all
expression content. Please use the `set:html` directive.

Expression content:
<p>Foggy weather displayed as&nbsp;<a href="/fog/" title="🌫 Fog">fog</a> covering a bridge or cityscape, depending on the platform. For platforms that
Unescaped HTML content found inside expression!

The next minor version of Astro will automatically escape all
expression content. Please use the `set:html` directive.

Expression content:
<a href="/library/emoji-1F301" target="_blank" rel="noreferrer noopener" class="redlink">🌁</a>
11:09 AM [astro] 500 /library/emoji-1F301                     
Rendering page for emoji πŸŒƒ   1F303
Unescaped HTML content found inside expression!

The next minor version of Astro will automatically escape all
expression content. Please use the `set:html` directive.

Expression content:
<p>A night sky with stars, depicted on major platforms as a <a href="/sunset/" title="πŸŒ‡ Sunset Over Buildings">cityscape</a> at night.</p>

Unescaped HTML content found inside expression!

The next minor version of Astro will automatically escape all
expression content. Please use the `set:html` directive.

Expression content:
<a href="/library/emoji-1F303" target="_blank" rel="noreferrer noopener" class="redlink">πŸŒƒ</a>
b-g commented 8 months ago

Hi @s-light, I'm afraid I can't reproduce if fully, see below. I get "Unescaped HTML content found inside expression!" as well ... but so far I have never noticed it :) and was not affecting anything. Could we not simply leave it and have this resolved with the next Astro update? It this a blocker for you? Sorry for the old Astra version from the stone age.

$ nvm use
Found '/Users/bene/Documents/openmoji-website/.nvmrc' with version <v14.16.1>
Now using node v14.16.1 (npm v6.14.12)
$ npm -v
6.14.12
$ node -v
v14.16.1
$ npm start

> openmoji.org@15.0.0 start /Users/bene/Documents/openmoji-website
> gulp copy-markdown-assets && node compress-json.mjs && astro dev

[12:06:32] Using gulpfile ~/Documents/openmoji-website/gulpfile.js
[12:06:32] Starting 'copy-markdown-assets'...
[12:06:32] Starting 'copy-markdown-samples-assets'...
[12:06:32] Finished 'copy-markdown-samples-assets' after 49 ms
[12:06:32] Starting 'copy-markdown-styleguide-assets'...
[12:06:32] Finished 'copy-markdown-styleguide-assets' after 29 ms
[12:06:32] Finished 'copy-markdown-assets' after 80 ms
JSON-file compressed
12:06 [astro] Server started                               697ms
12:06 [astro] Local: http://127.0.0.1:3000/
Rendering home page index.astro
Unescaped HTML content found inside expression!

The next minor version of Astro will automatically escape all
expression content. Please use the `set:html` directive.

Expression content:
proof of concept / Beta versions,<br />not intended for production use!
Rendering home page index.astro
Unescaped HTML content found inside expression!

The next minor version of Astro will automatically escape all
expression content. Please use the `set:html` directive.

Expression content:
proof of concept / Beta versions,<br />not intended for production use!
s-light commented 8 months ago

Could we not simply leave it and have this resolved with the next Astro update?

yeah of course. so i will close the issue for now ?

b-g commented 8 months ago

Yes + Sorry again!