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

Fix: meeting important dates can have markdown links #6594

Merged
merged 5 commits into from
Nov 10, 2023

Conversation

evyncke
Copy link
Contributor

@evyncke evyncke commented Nov 4, 2023

To address feat #3911

Added a filter for the Django templates: 'markdown'

Data migration includes changing the important dates description to include the right markdown links.

Still to do (another issue to be created?) as some links in important dates include the actual meeting number :-(

@evyncke evyncke changed the base branch from main to feat/rfc November 4, 2023 14:05
@evyncke evyncke changed the title Fix 3911: meeting important dates can have markdown links Fix: meeting important dates can have markdown links Nov 4, 2023
Comment on lines 237 to 247
string = bleach_cleaner.clean(
python_markdown.markdown(
string,
extensions=[
"extra",
"nl2br",
"sane_lists",
"toc",
],
)
)
Copy link
Collaborator

@larseggert larseggert Nov 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't you use/call the code in ietf/utils/markdown.py?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of a loop between the import statement (and no clue how to break this loop)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the same vein, I am unsure whether "toc" & "nl2br" extensions are useful or dangerous

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rjsparks
Copy link
Member

rjsparks commented Nov 5, 2023

I pushed a commit that moves the new filter to avoid the circular import (and simplifies it to use utils.markdown).

Tests don't pass, but it's not this PRs fault.

@evyncke
Copy link
Contributor Author

evyncke commented Nov 5, 2023

I pushed a commit that moves the new filter to avoid the circular import (and simplifies it to use utils.markdown).

thanks, nicer indeed

@rjsparks
Copy link
Member

rjsparks commented Nov 6, 2023

See the failed test run - the changes are producing html that doesn't validate.

For example

                                 <td>
                                    Cut-off date for revised BOF proposal requests to Area Directors at UTC 23:59. To request a BOF, please see instructions at <a href="https://www.ietf.org/how/bofs/bof-procedures"></a><a href="https://www.ietf.org/how/bofs/bof-procedures&lt;/a>">https://www.ietf.org/how/bofs/bof-procedures</a> on Requesting a BOF.
                                                                                                                                                                 ^
                                                                                                                                                                 wcag/h30: Anchor link must have a text describing its purpose on line 721:162

@jennifer-richards
Copy link
Member

See the failed test run - the changes are producing html that doesn't validate.

This was happening because the linkify filter was confusing the markdown filter. Reversing these avoids the problem and I think even does the right thing.

@evyncke
Copy link
Contributor Author

evyncke commented Nov 9, 2023

This was happening because the linkify filter was confusing the markdown filter. Reversing these avoids the problem and I think even does the right thing.

Indeed ! Thanks

@rjsparks rjsparks merged commit 639043e into ietf-tools:feat/rfc Nov 10, 2023
5 of 7 checks passed
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants