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 table in markdown and use dsfr table style #432

Merged
merged 3 commits into from
Jun 20, 2024

Conversation

nicolaskempf57
Copy link
Contributor

Fix datagouv/data.gouv.fr#1345

To use DSFR table, we must allow <div> tag and class attribute in settings, like below. This will be added to udata settings.

MD_ALLOWED_TAGS = [
        'a',
        'abbr',
        'acronym',
        'b',
        'br',
        'blockquote',
        'code',
        'dd',
        'del',
        'div',
        'dl',
        'dt',
        'em',
        'h1',
        'h2',
        'h3',
        'h4',
        'h5',
        'h6',
        'hr',
        'i',
        'img',
        'li',
        'ol',
        'p',
        'pre',
        'small',
        'span',
        'strong',
        'ul',
        'sup',
        'sub',
        'table',
        'td',
        'th',
        'tr',
        'tbody',
        'thead',
        'tfooter',
        'details',
        'summary'
        # 'title',
    ]

    MD_ALLOWED_ATTRIBUTES = {
        'a': ['href', 'title', 'rel', 'data-tooltip'],
        'abbr': ['title'],
        'acronym': ['title'],
        'div': ['class'],
        'img': ['alt', 'src', 'title']
    }

Copy link
Contributor

@ThibaudDauce ThibaudDauce left a comment

Choose a reason for hiding this comment

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

👍

@nicolaskempf57 nicolaskempf57 merged commit 0249046 into master Jun 20, 2024
8 checks passed
@nicolaskempf57 nicolaskempf57 deleted the fix/markdown-jinja branch June 20, 2024 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Affichage tableau markdown cassé dans les *pages*
2 participants