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

Add support for embedding script tags in markdown pages. #305

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@jmitchell
Contributor

jmitchell commented May 30, 2014

Disabled by default, but can be enabled on a per-page basis using the 'allowscripts' frontmatter.

@jmitchell

View changes

Show outdated Hide outdated hugolib/page.go
@jmitchell

This comment has been minimized.

Show comment
Hide comment
@jmitchell

jmitchell May 30, 2014

Contributor

Issue #262 points out that the speakerdeck shortcode for spf13.com isn't working. Accepting this change and adding allowscripts: true to that page's frontmatter fixes it.

Another example use case: I'd like publish a series of interactive page using Tangle. Each page needs its own specialized logic, so it's not appropriate to throw all the JavaScript into a global file that's loaded on every page.

Support for embedded scripts would enable a whole lot more useful shortcodes.

Contributor

jmitchell commented May 30, 2014

Issue #262 points out that the speakerdeck shortcode for spf13.com isn't working. Accepting this change and adding allowscripts: true to that page's frontmatter fixes it.

Another example use case: I'd like publish a series of interactive page using Tangle. Each page needs its own specialized logic, so it's not appropriate to throw all the JavaScript into a global file that's loaded on every page.

Support for embedded scripts would enable a whole lot more useful shortcodes.

@spf13

This comment has been minimized.

Show comment
Hide comment
@spf13

spf13 May 31, 2014

Contributor

It's a good commit, but why not just always accept embedded scripts? There's no security difference between that and this since anyone who can add this to the front matter can also add scripts to the markdown in the same file.

I'm not clear on the reasoning for selectively enabling it.

Contributor

spf13 commented May 31, 2014

It's a good commit, but why not just always accept embedded scripts? There's no security difference between that and this since anyone who can add this to the front matter can also add scripts to the markdown in the same file.

I'm not clear on the reasoning for selectively enabling it.

@jmitchell

This comment has been minimized.

Show comment
Hide comment
@jmitchell

jmitchell May 31, 2014

Contributor

That's true. Stripping the configuration would make this a lot simpler too. I'll go ahead and do that.

Contributor

jmitchell commented May 31, 2014

That's true. Stripping the configuration would make this a lot simpler too. I'll go ahead and do that.

@spf13 spf13 added the enhancement label Jun 3, 2014

@jmitchell

This comment has been minimized.

Show comment
Hide comment
@jmitchell

jmitchell Jun 3, 2014

Contributor

I've updated the pull request to allow scripts by default.

Contributor

jmitchell commented Jun 3, 2014

I've updated the pull request to allow scripts by default.

@spf13

This comment has been minimized.

Show comment
Hide comment
@spf13

spf13 Jun 3, 2014

Contributor

merged as e0ea6b9

Contributor

spf13 commented Jun 3, 2014

merged as e0ea6b9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment