codalab / codabench

Codabench is a flexible, easy-to-use and reproducible benchmarking platform. Check our paper at Patterns Cell Press https://hubs.li/Q01fwRWB0
Apache License 2.0
63 stars 26 forks source link

HTML not interpreted #836

Closed Didayolo closed 1 year ago

Didayolo commented 1 year ago

HTML pages are not well rendered by Codabech. Only markdown works.

Related issues:

Example:

Capture d’écran 2023-05-04 à 18 16 56
Didayolo commented 1 year ago

I confirm that the HTML inside .md files is not interpreted either.

Didayolo commented 1 year ago

We have this in utils.js:

function sanitize_HTML(input, extra_settings) {
    extra_settings = extra_settings || {}
    input = input || ''
    extra_settings.FORBID_TAGS = _.union(extra_settings.FORBID_TAGS, ['style'])
    extra_settings.FORBID_ATTR = _.union(extra_settings.FORBID_ATTR, ['style'])

    return DOMPurify.sanitize(input, extra_settings)
}

function render_markdown(input, extra_settings) {
    extra_settings = extra_settings || {}
    input = input || ''
    if(EasyMDE.prototype.options === undefined) {
        EasyMDE.prototype.options = {
            renderingConfig: easyMDE_rendering_config
        }
    }
    return sanitize_HTML(EasyMDE.prototype.markdown(input), extra_settings)
}