Render a supplier's plain agenda text as markdown, so its links are links - #300
Merged
Conversation
…inks Notubiz hands over HTML for meeting and agenda descriptions; iBabs hands over plain text that griffies write with markdown in it. Both were inserted as HTML, so Harderwijk's "[www.harderwijk.nl/vergaderingen](...)" appeared with its brackets and unclickable, with 
 entities in between (#295). Text without the tags a supplier's HTML uses is now decoded, escaped and rendered as markdown: links become links, line breaks survive, and nothing in it can become markup of its own. HTML is passed through as before.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #295.
Meeting and agenda descriptions are inserted with
{@html}. That suits Notubiz, which hands over HTML, but iBabs hands over plain text that griffies write with markdown in it: Harderwijk's[www.harderwijk.nl/vergaderingen](https://www.harderwijk.nl/vergaderingen)showed with its brackets, unclickable, with
carriage-return entities between the paragraphs.renderSupplierTextnow decides per text: if it contains the tags a supplier's HTML actually uses (p,br,a, lists, headings, tables...) it is passed through as before; otherwise numeric entities are decoded, the text is escaped and rendered as markdown with line breaks kept. So links become links, and a stray<script>in plain text is shown as text rather than executed, which the old passthrough would not have guaranteed.Two tests: the Harderwijk text (link rendered, entities gone, angle brackets escaped) and HTML passthrough.