Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paste has tags and attributes stripped #594

Closed
davetimmins opened this issue Jan 12, 2021 · 2 comments
Closed

Paste has tags and attributes stripped #594

davetimmins opened this issue Jan 12, 2021 · 2 comments
Labels

Comments

@davetimmins
Copy link

davetimmins commented Jan 12, 2021

I'm pasting this into the editor

<div class="divRuleText ol1">
<ol>
<li>This strategic framework sets the policy direction for the City Plan and has a planning horizon of 2031. As the major element of the City Plan, it will help to protect and enhance the Gold Coast’s outstanding lifestyle by ensuring appropriate and sustainable development occurs within the City Plan area for the life of the City Plan.</li>
<li>Mapping that gives essential spatial dimension to the strategic framework is included in Part 3 and <a class="crossreflink" href="/eplan/#Rules/0/159/1/19345/0" onclick="LinkSection(159,19345, 61, 2283, &quot;&quot;); return false;">Schedule 2 – Mapping</a>.</li>
<li>For the purpose of describing the policy direction for the City Plan the strategic framework is structured in the following way:
<ol style="list-style-type: lower-alpha">
<li>The strategic intent;</li>
<li>The following six city shaping themes that play an important role in shaping future growth and managing change across the city, and collectively represent the policy intent of the City Plan:
<ol style="list-style-type: lower-roman">
<li>Creating liveable places;</li>
<li>Making modern centres;</li>
<li>Strengthening and diversifying the economy;</li>
<li>Improving transport outcomes;</li>
<li>Living with nature; and</li>
<li>A safe, well designed city.</li>
</ol>
</li>
<li>The strategic outcomes proposed for development in the City Plan area for each theme.</li>
<li>The elements that refine and further describe the strategic outcomes.</li>
<li>The specific outcomes sought for each of the elements.</li>
</ol>
</li>
<li>Although each theme has its own section, the strategic framework is read in its entirety as the policy direction for the City Plan.</li>
</ol>
</div>

but it has some text stripped and ends up as this (note <div class="divRuleText ol1"> is removed)

<ol>
    <li>This strategic framework sets the policy direction for the City Plan and has a planning horizon of 2031. As the major element of the City Plan, it will help to protect and enhance the Gold Coast’s outstanding lifestyle by ensuring appropriate and sustainable development occurs within the City Plan area for the life of the City Plan.</li>
    <li>Mapping that gives essential spatial dimension to the strategic framework is included in Part 3 and <a class="crossreflink" href="/eplan/#Rules/0/159/1/19345/0">Schedule 2 – Mapping</a>.</li>
    <li>For the purpose of describing the policy direction for the City Plan the strategic framework is structured in the following way:        
        <ol>
            <li>The strategic intent;</li>
            <li>The following six city shaping themes that play an important role in shaping future growth and managing change across the city, and collectively represent the policy intent of the City Plan:                
                <ol>
                    <li>Creating liveable places;</li>
                    <li>Making modern centres;</li>
                    <li>Strengthening and diversifying the economy;</li>
                    <li>Improving transport outcomes;</li>
                    <li>Living with nature; and</li>
                    <li>A safe, well designed city.</li>
                </ol>
</li>
            <li>The strategic outcomes proposed for development in the City Plan area for each theme.</li>
            <li>The elements that refine and further describe the strategic outcomes.</li>
            <li>The specific outcomes sought for each of the elements.</li>
        </ol>
</li>
    <li>Although each theme has its own section, the strategic framework is read in its entirety as the policy direction for the City Plan.</li>
</ol>

is there a way I can keep what was pasted?

Thanks

@JiHong88
Copy link
Owner

@davetimmins ,
Editor removes disallowed attributes and fix formats that don't fit.

  1. Removes the style of other tags except the "span" tag when pasting.
    Add this option.
suneditor.create('', {
  attributesWhitelist: {
   // all: 'style',
    ol: 'style',
  }
})
  1. Class properties that do not start with se- or __se__ are discarded.
    If you give the class'__se__tag' to the top tag, the lower node is not checked.
<div class="__se__tag divRuleText ol1">
</div>

@davetimmins
Copy link
Author

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants