citynetwork / markdown-xblock

An XBlock enabling Open edX course authors to maintain content in Markdown.
GNU Affero General Public License v3.0
3 stars 3 forks source link

Update safe mode #14

Closed fghaas closed 3 years ago

fghaas commented 3 years ago

In Markdown2, safe_mode is actually a string, currently supporting the values replace and escape. Support for the Boolean value is only maintained for compatibility with Markdown, a Boolean value of True is equivalent to replace.

Retain the default of replace, but add the ability to also set escape. Also, interpret True as equivalent to 'replace', and False or None (and the empty string) to mean to disable safe mode.

Add test cases for all of the above. Also, add a GitHub Actions workflow.

fghaas commented 3 years ago

Yes we did discuss that at one point, though we didn't come to a good conclusion of whether we wanted course authors to be able to both restrict and relax the system-wide setting, or to only restrict it. I still don't have a good answer for that.

If it's OK with you I'd merge this PR now, and then we can revisit the attribute question separately. Does that sound reasonable?

mrtmm commented 3 years ago

Sounds good to me, thanks!

fghaas commented 3 years ago

Ack. I've made one more edit to the README and added a reno, will proceed to merge now.