Giter VIP home page Giter VIP logo

Comments (3)

boutell avatar boutell commented on July 22, 2024

You need to enable some more tags in the html filtering. There is a
provision for passing options to the clean html module in your app js
configuration. I can dig up an example tomorrow if needed.

We filter html to guarantee no awful surprises after pastes from word and
the like.
On Nov 13, 2013 9:23 PM, "Danny Povolotski" [email protected]
wrote:

I have the following area set up:

{{ aposArea(page, 'header2', {
textOnly: true,
controls: [ 'style', 'bold', 'italic' ],
styles: [
{ element: 'h2', label: 'Heading 2' },
{ element: 'h3', label: 'Heading 3' }
]
}) }}

I select the "h2" style, and it looks correct. Once I save and go back to
that page - I no longer see the "h2" element, but a "p" element
encompassing my content.


Reply to this email directly or view it on GitHubhttps://github.com//issues/13
.

from apostrophe-editor-2.

israelidanny avatar israelidanny commented on July 22, 2024

I will take a look at it later today, but I reckon that an example would benefit the community. I'm sure I wouldn't be the first person to stumble upon this.

from apostrophe-editor-2.

boutell avatar boutell commented on July 22, 2024

In app.js, where you configure your site with apostrophe-site, set the
sanitizeHtml option up, like this:

sanitizeHtml: {
allowedTags: [ 'h3', 'h4', 'h5', 'h6', 'blockquote', 'p', 'a', 'ul',
'ol', 'nl', 'li', 'b', 'i', 'strong', 'em', 'strike', 'code', 'hr', 'br',
'div', 'table', 'thead', 'caption', 'tbody', 'tr', 'th', 'td', 'pre' ],
allowedAttributes: {
a: [ 'href', 'name', 'target' ],
// We don't currently allow img itself by default, but this
// would make sense if we did
img: [ 'src' ]
}
}

The above is the default configuration.

Note that allowed attributes are specified on a per-tag basis. If you are
not changing the allowed attributes you can skip that property.

We feel pretty strongly that users should not be entering styles - it
defeats efforts to create responsive sites that work on all screen sizes
through good professional design and frontend development work. So we never
allow the style attribute.

But adding new tags sometimes makes sense, particularly if in your design
h1 and h2 are not reserved for use in templates as they typically are in
ours.

On Thu, Nov 14, 2013 at 5:05 AM, Danny Povolotski
[email protected]:

I will take a look at it later today, but I reckon that an example would
benefit the community. I'm sure I wouldn't be the first person to stumble
upon this.


Reply to this email directly or view it on GitHubhttps://github.com//issues/13#issuecomment-28472130
.

Tom Boutell
P'unk Avenue
215 755 1330
punkave.com
window.punkave.com

from apostrophe-editor-2.

Related Issues (20)

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.