hacs / integration

HACS gives you a powerful UI to handle downloads of all your custom needs.
https://hacs.xyz
MIT License
5.41k stars 1.29k forks source link

Github Blockquote Notes are not rendered correctly in HACS frontend. #3995

Closed BJReplay closed 2 months ago

BJReplay commented 2 months ago

Web browser

Chromium (tried in both Edge and Chrome)

Web browser version

Version 129.0.2779.0 (Official build) dev (64-bit)

System Health details

System Information

version core-2024.8.2
installation_type Home Assistant Container
dev false
hassio false
docker true
user root
virtualenv false
python_version 3.12.4
os_name Linux
os_version 6.6.36.3-microsoft-standard-WSL2
arch x86_64
timezone Australia/Sydney
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok HACS Data | ok GitHub API Calls Remaining | 5000 Installed Version | 2.0.0 Stage | running Available Repositories | 1393 Downloaded Repositories | 25
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Dashboards dashboards | 6 -- | -- resources | 16 views | 5 mode | storage
Recorder oldest_recorder_run | 12 August 2024 at 8:35 am -- | -- current_recorder_run | 22 August 2024 at 1:39 pm estimated_db_size | 510.38 MiB database_engine | sqlite database_version | 3.45.3
Solcast PV Forecast can_reach_server | ok -- | -- used_requests | 32 rooftop_site_count | 1

Checklist

Describe the issue

HACS 2.0 displays readme.md blockquotes much better than 1.3.4, but leaves out the entire first paragraph / sentence for some reason for [!NOTE] blockquotes.

The current readme for this issue is at https://github.com/BJReplay/ha-solcast-solar/blob/main/README.md

An earlier version that won't change is at https://github.com/BJReplay/ha-solcast-solar/blob/66331bb39ba80f4003ab47cabc0d3f427adf59e6/README.md

Reproduction steps

  1. Add https://github.com/bjreplay/ha-solcast-solar as a custom integration to HACS
  2. Browse to HACS in HA, and click on the Solcast PV Solar integration in Downloaded repositories
  3. Observe that the [!NOTE] blockquotes are missing the first sentence / paragraph. ...

Screenshots

Image from HACS:

image

Image from Github (Note, - the issue isn't so much the missing Warning or Note text, but the entire missing sentences).

The sentence The use of beta versions can be a simple way to fix issues. Check the releases at is missing from the first note, and the sentence (paragraph) This integration can be used as a replacement for the oziee/ha-solcast-solar integration, which has been removed from GitHub and HACS. is missing from the second note.

image

Javascript logs from your browser console

Nothing recorded.

Diagnostics dump

Not applicable (please let me know if I'm incorrect in this assessment, and I'll provide).

hacs-bot[bot] commented 2 months ago

Make sure you have read the issue guidelines and that you filled out the entire template.

If you have an issue identical to this, do not add comments like "same here", "i have this too", instead add a :+1: reaction to the issue description. Thanks! :+1:

ludeeus commented 2 months ago

Is this a HACS or Home Assistant problem? If you paste the same in a markdown card is it different?

BJReplay commented 2 months ago

Is this a HACS or Home Assistant problem? If you paste the same in a markdown card is it different?

Stand by...

Testing...

BJReplay commented 2 months ago

Is this a HACS or Home Assistant problem?

HACS, I think:

image

image

ludeeus commented 2 months ago

Try the entire file.

BJReplay commented 2 months ago

Yeah, I just did, thinking that the first test wasn't enough!

image

autoSteve commented 2 months ago

Google Fit is another example that I found, @ludeeus. https://github.com/YorkshireIoT/ha-google-fit.

ludeeus commented 2 months ago

Yeah, have verified there is some difference even on HA dev.

ludeeus commented 2 months ago

I took a look at it, and the markdown card uses a slightly different approach to how content breaks. HACS uses the same as add-ons, which have the same problems.

So I think this is something that needs to be handled on the Home Assistant frontend as this will be a problem for add-ons as well.

BJReplay commented 2 months ago

HACS uses the same as add-ons, which have the same problems.

As I'm using HA in a container, I don't have access to add-ons, so can't repro.

Will you raise this issue in the HA front end?

elchininet commented 2 months ago

Hi @ludeeus, Is not this logic the one that manages that?

elchininet commented 2 months ago

Testing the public content property of the ha-markdown-element that is rendered, the text is there, it seems that it gets choped off by the logic of that component.

image

Edit: Weird, I tested that logic in the marked playground and everything seems to be OK, the text is contained in the final array that is append to the ha-alert element. 🤔

image
ludeeus commented 2 months ago

This is correct. It behaves differently depending on whether you pass it break or not (the markdown card does); HACS and add-ons do not. https://github.com/hacs/integration/issues/3995#issuecomment-2304271044 Witch has the side-effect of messing with other things like the badges are not all vertical.