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

Weather alert new lines added in middle of sentences #367

Open
4 tasks done
mbomb007 opened this issue Nov 6, 2024 · 2 comments
Open
4 tasks done

Weather alert new lines added in middle of sentences #367

mbomb007 opened this issue Nov 6, 2024 · 2 comments

Comments

@mbomb007
Copy link

mbomb007 commented Nov 6, 2024

Describe the bug

Newlines were recently added to weather alerts. They are added in the middle of sentences where they shouldn't be.

Expected behavior

I expect the text to have each section separated by newlines, but not wrap early.

"* WHAT...Visibility Below One Half Mile In Dense Fog.

* WHERE...Portions Of Northwest And West Central Iowa, Southwest Minnesota, And Central, East Central, South Central, And Southeast South Dakota.

* WHEN...Until 10 AM CST This Morning.

* IMPACTS...Low Visibility Could Make Driving Conditions Hazardous."

Southwest Minnesota ... Southeast South Dakota

Actual behavior

Example:

"* WHAT...Visibility Below One Half Mile In Dense Fog.

* WHERE...Portions Of Northwest And West Central Iowa, Southwest
Minnesota, And Central, East Central, South Central, And Southeast
South Dakota.

* WHEN...Until 10 AM CST This Morning.

* IMPACTS...Low Visibility Could Make Driving Conditions Hazardous."

Southwest \n Minnesota ... Southeast \n South Dakota

It's like the text is wrapped at a certain column, but since websites are dynamically sized, this wouldn't look good if I replaced the newlines with <br>, because the lines would be in the wrong place.

API Endpoint

Production

Location

Sioux Falls, SD

Other details

No response

Troubleshooting steps

  • I have searched this repository and Home Assistant Repository to see if the issue has already been reported.
  • I have read through the API documentation before opening this issue.
  • I have not included my API key anywhere in my issue.
  • I have written an informative title.
@cloneofghosts
Copy link
Collaborator

I took a look at the NWS alert page and the .cap file and the weird line breaks are coming directly from NWS.

I will still ping @alexander0042 to take a look and see if its possible for the API to manually add in the line breaks.

@mbomb007
Copy link
Author

mbomb007 commented Nov 6, 2024

Since I'm converting the result to HTML anyway, it's easiest for me to just ignore the line breaks and add <br> after each section. (Rather than replacing \n with <br>)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

3 participants