Comments (3)
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.
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.
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)
- test issue
- LESS warning about @white being undefined in editor.less
- Add Content buttons in modals not displaying a menu
- Controls atop text HOT 1
- Cannot click on text that is in the same vertical area as the controls (there is an acceptable workaround) HOT 2
- Too many page versions
- Need a friendlier UI for rolling back changes at the area level HOT 1
- Controls go away and do not come back
- Where are the editable singletons on the sandbox home page? It's fun to guess! Wait, it's not that much fun. HOT 4
- lockups can happen without specifying them in aposArea options HOT 1
- Hovering over the drop-down also triggers visibility of underlying buttons, which leads to annoying accidental clicks HOT 2
- Left / Right button align gets very ugly on narrower columns HOT 4
- Our custom ckeditor theme is a hot mess in Firefox HOT 1
- Test apostrophe ckeditor theme in IE
- Schema Widgets do not save when put into a lockup HOT 3
- Can't include CKeditor plugin
- Add Content button should appear on bottom of area aswell HOT 7
- Editor stripping iframes HOT 6
- Error - node_modules/moog/index.js:317 if (key.substr(0, 2) === '__') { HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apostrophe-editor-2.