Giter Site home page Giter Site logo

rickrockstar's Introduction

Test application to debug white listing

I'm having a problem with config.wymeditor_whitelist_tags. I'm either using the wrong syntax or there is a bug.

Scenario

My client needs to enter a sublime video tags/markup in the content editor (WYMeditor).

<video class="sublime" width="640" height="360" poster="video-poster.jpg" data-uid="my-video-1" data-name="My Video #1" preload="none">
  <source src="http://yoursite.com/video.mp4" />
  <source src="http://yoursite.com/video-mobile.mp4" />
  <source src="http://yoursite.com/video.webm" />
</video>

The problem is after saving hitting the "Save and continue editing" button, it immediately sanitizes the html and leaves me with this:

<video class="sublime" data-uid="my-video-1" data-name="My Video #1">
  <source>
  <source>

I've tried to edit the config.wymeditor.whitelist.tags option several different ways with no luck:

# config/initializers/refinery/core.rb
...

# Add extra tags to the wymeditor whitelist e.g. = {'tag' => {'attributes' => {'1' => 'href'}}} or just {'tag' => {}}
config.wymeditor_whitelist_tags = {'source' => {}}
config.wymeditor_whitelist_tags = {'<source>' => {}}
config.wymeditor_whitelist_tags = {'source' => {'attributes' => {'1' => 'src'}}}
config.wymeditor_whitelist_tags = {'<source>' => {'attributes' => {'1' => 'src'}}}

But I get the same result either way.

I also tried adding a custom tag, just to see if it was a problem with the source tag:

config.wymeditor_whitelist_tags = {'jess' => {}}

and it would not allow me to use the <jess> tag either.

I of course restarted the server each time I made a change.

rickrockstar's People

Contributors

jess avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.