ejholmes / active_admin_editor

Rich text editor for Active Admin using wysihtml5.
MIT License
184 stars 134 forks source link

Internal Links are parsed out for src and href #50

Open abatkins opened 10 years ago

abatkins commented 10 years ago

The parser is removing internal links from src and href. The cases I have found look like this:

<img src="/image.png"> => <img alt="">

and

<a href="/file.pdf"> => <a target="_blank"></a>

Tried overriding the parser rules in config/active_admin_editor.rb with:

  config.parser_rules['tags']['img'] = { # allows iframes
      check_attributes: {
          width: 'numbers',
          alt: 'alt',
          src: 'src', # if you compiled master manually then change this from 'url' to 'src'
          height: 'numbers'
      }
  }

However, this just made the src to be parsed out even if it had http:// in it.

The documentation says internal links are allowed, so I am not sure what the issue is.