Medium.js
Medium.js copied to clipboard
Alternative outer-level tags
On the docs page there is an example of how to create some tags other than
on the root level of an edited element. Bu this works only with tags: null, i.e. no additional control upon tag usage. But is there a way to implement the former and still keep the latter? In particular, I would like to have forced paragraph and line break tags, limiting inner-level tags and such other cool stuff, but with the ability to occasionally insert some h1, h2, ul>li, blockquote, etc.
Or, to put it in another way, how to apply the tags,that are allowed in tags.outerLevel?
Sorry, accidentally doubleposted this, https://github.com/jakiestfu/Medium.js/issues/147.
I was having a problem inserting custom tags (h1, h2, h3, center), and this helped.
/me high fives arielsvn
Although this doesn't solve the problem, when you use invokeElement it seems to add an inline element, instead of adding the h1 or h2 tags as root elements.
When you execute el.medium.invokeElement('h1', {}) and el.medium.invokeElement('h2', {}) the resulting HTML is like this, check this fiddle:
<h1 class="medium-h1">
<h2 class="medium-h2">title</h2>
</h1>
When the expected behaviour should only contain either h1 or h2. This seems like a very common use case, so there must be something we're missing. And I can't find any docs about this.
You guys are right. There is a separate thread on this, I need to implement block detection, I've just been very busy. I will take a look at this tomorrow.
@robertleeplummerjr Hi :) I have the same problems, were there any improvement concerning this issue since Apr 2015 ?