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 HTML elements details and summary #285

Open
Steve-Mcl opened this issue Oct 5, 2019 · 0 comments
Open

Allow HTML elements details and summary #285

Steve-Mcl opened this issue Oct 5, 2019 · 0 comments

Comments

@Steve-Mcl
Copy link
Contributor

Steve-Mcl commented Oct 5, 2019

Hi,

would you consider permitting details and summary
Ref: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details

Here is a working example...
2019-10-05_17-39-07

Code changes are quite simple...

openKB.js...

       var cleanHTML = sanitizeHtml(fixed_html, {
            allowedTags: [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'p', 'a', 'ul', 'ol',
                'nl', 'li', 'b', 'i', 'strong', 'em', 'strike', 'code', 'hr', 'br', 'div',
                'table', 'thead', 'caption', 'tbody', 'tr', 'th', 'td', 'pre', 'img', 'iframe',
                'details','summary'  /* << Add details and summary */
            ],
            allowedAttributes: false
        });

common.js...

    return sanitizeHtml(html, {
        allowedTags: [ 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote', 'p', 'a', 'ul', 'ol',
            'nl', 'li', 'b', 'i', 'strong', 'em', 'strike', 'code', 'hr', 'br', 'div',
            'table', 'thead', 'caption', 'tbody', 'tr', 'th', 'td', 'pre', 'img', 'iframe',
            'details','summary' /* << Add details and summary */
        ],
        allowedAttributes: false  
    });
mintyhippoxyz added a commit to RTVision/openKB that referenced this issue Mar 13, 2020
mintyhippoxyz added a commit to RTVision/openKB that referenced this issue May 4, 2020
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

No branches or pull requests

1 participant