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

Caption popup: too much spacing when using the # markup. #1854

Closed
dawansv opened this issue May 22, 2024 · 0 comments · Fixed by #1865
Closed

Caption popup: too much spacing when using the # markup. #1854

dawansv opened this issue May 22, 2024 · 0 comments · Fixed by #1865
Labels

Comments

@dawansv
Copy link

dawansv commented May 22, 2024

Describe the bug
There is too much spacing in the caption popup when using the # markup.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://umap.openstreetmap.fr/en/map/reseau-de-benso-jamanu-en-2020_701348
  2. Click on any data point
  3. in the caption popup, notice the extra spacing below the popup heading

Expected behavior
More proportional spacing expected as shown in preferred version at bottom

Screenshots
image

Desktop (please complete the following information):

  • OS: Win11
  • Browser Edge
  • Version 125.0.2535.51

Additional context
The popup underlying template is as such:

# {Type} de {Guichet}
Agence: **{Agence}**
Commune: **{Commune}**
Cercle: **{Cercle}**
Année de Création: **{Annee_Creation}**
Accessibilité: **{Accessibilite}**

It appears the code is using <br> elements to implement line breaks. However the # markup also calls for <h3>, hence the final code has <h3><br> which creates a double line break, hence the extra space. Also line height for <h3> is set to 3.

I have removed the extra <br> below <h3> and set line-height to 1.75 in my preferred version below

image

@dawansv dawansv added the bug label May 22, 2024
yohanboniface added a commit that referenced this issue May 29, 2024
Basically, we do not add `<br>` anymore, but instead let the newline
and use the css `white-space: pre-line;`. Also remove new lines after
title.

While doing that change, I needed to reorder regex so the ones needing
a newline before would still have it (bullets points).

I've added tests and removed some to cover those changes.

fix #1854
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant