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

Allow MarkDown and HTML in Annoucements #1161

Closed
jacobwod opened this issue Sep 7, 2022 · 2 comments
Closed

Allow MarkDown and HTML in Annoucements #1161

jacobwod opened this issue Sep 7, 2022 · 2 comments
Assignees
Labels
module:client/core Core functionality (not a plugin) new feature Request for adding/changing functionality
Milestone

Comments

@jacobwod
Copy link
Member

jacobwod commented Sep 7, 2022

Annoucements (added in #161) is a long-standing experimental feature.

The current implementation is limited as it only allows pure text. No MD nor HTML is allowed:
Skärmavbild 2022-09-07 kl  10 14 36

While allowing MD would increase the weight of the component significantly, I'll wait with that. But adding support for pure HTML formatting shouldn't affect performance.

@jacobwod jacobwod added module:client/core Core functionality (not a plugin) new feature Request for adding/changing functionality labels Sep 7, 2022
@jacobwod jacobwod added this to the 3.x milestone Sep 7, 2022
@jacobwod jacobwod self-assigned this Sep 7, 2022
@jacobwod
Copy link
Member Author

jacobwod commented Sep 7, 2022

On a second thought: I'm allowing HTML too. This is needed if we want to make line breaks (using <br> or <p>). This wouldn't be possible in the current solution because a carrige return isn't allowed inside a JSON string:

{
      "id": 7,
      "active": true,
      // Not possible:
      "text": "Some text with a line break at the end.
                   A new line here.

                   We can do a paragraph too.",
      "showOnlyOnce": false,
      "type": "info"
    }

However, using HTML, we can do this:

{
      "id": 7,
      "active": true,
      "text": "Some text with a line break at the end<br>A new line here.<br><br>We can do a paragraph too.",
      "showOnlyOnce": false,
      "type": "info"
    }

The result will look like the second (blue) box:
Skärmavbild 2022-09-07 kl  10 52 34

@jacobwod jacobwod changed the title Allow HTML in Annoucements Allow MarkDown and HTML in Annoucements Sep 7, 2022
@jacobwod
Copy link
Member Author

jacobwod commented Sep 7, 2022

OK, pretty much done. This should significantly broaden the limits of what's possible with our Announcements function in Hajk.


Skärmavbild 2022-09-07 kl  11 03 57

@jacobwod jacobwod modified the milestones: 3.x, 3.11 Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module:client/core Core functionality (not a plugin) new feature Request for adding/changing functionality
Projects
None yet
Development

No branches or pull requests

1 participant