在li和p标签之后添加br标签

时间:2016-12-12 11:31:40

标签: html tinymce umbraco

我在umbraco中有一个RTE,它有以下标记

    <p><strong>Lorem ipsum dolor sit amet, nisl sonet mnesarchum vis ex, nec quas posse assueverit an. Eam an doming docendi, et mundi eripuit vim. An nisl tota imperdiet usu. Mazim aeque instructior quo ad, ex cum debet mundi, in omittam dignissim sed. An cum summo lucilius oportere, copiosae vituperata definitiones has id. Vis sale mucius id, duo enim definitionem ne.</strong></p>
    <p>Quem meis pro ne. Has et brute denique. At mei maiorum similique enter code herevoluptatibus, saepe efficiendi ullamcorper qui ne. Admodum detraxit interesset at usu, ei mea admodum fuisset petentium, numquam accumsan conceptam ne sea.</p>
    <ul>
    <li><span>Sed ut perspiciatis unde omnis iste natus error sit voluptatem </span></li>
    <li><span>Accusantium doloremque laudantium, totam rem </span></li>
    <li><span>Aperiam, eaque ipsa quae ab illo inventore veritatis et quasi </span></li>
    <li><span>Architecto beatae vitae dicta sunt <a data-id="2831" href="/{localLink:2831}" target="_blank" title="United Kingdom">explicabo</a></span></li>
    </ul>
    <div class="umb-loader" style="height: 10px; margin: 10px 0px;"></div>
    <p style="text-align: center;"><iframe width="615" height="346" src="https://www.youtube.com/embed/ScMzIvxBSi4?feature=oembed" frameborder="0" allowfullscreen=""></iframe></p>

但是当它输出到屏幕时,它会添加如下的

标签
                    <p><strong>Lorem ipsum dolor sit amet, nisl sonet mnesarchum vis ex, nec quas posse assueverit an. Eam an doming docendi, et mundi eripuit vim. An nisl tota im`enter code here`perdiet usu. Mazim aeque instructior quo ad, ex cum debet mundi, in omittam dignissim sed. An cum summo lucilius oportere, copiosae vituperata definitiones has id. Vis sale mucius id, duo enim definitionem ne.</strong></p><br>
<p>Quem meis pro ne. Has et brute denique. At mei maiorum similique voluptatibus, saepe efficiendi ullamcorper qui ne. Admodum detraxit interesset at usu, ei mea admodum fuisset petentium, numquam accumsan conceptam ne sea.</p><br>
<ul><br>
<li><span>Sed ut perspiciatis unde omnis iste natus error sit voluptatem </span></li><br>
<li><span>Accusantium doloremque laudantium, totam rem </span></li><br>
<li><span>Aperiam, eaque ipsa quae ab illo inventore veritatis et quasi </span></li><br>
<li><span>Architecto beatae vitae dicta sunt <a data-id="2831" href="/united-kingdom/" target="_blank" title="United Kingdom">explicabo</a></span></li><br>
</ul><br>

我有什么想法可以阻止它这样做吗?

提前致谢

更新添加了tinymce config

<?xml version="1.0" encoding="utf-8" ?>
<!-- Any changes to this file requires the application (umbraco) to restart -->
<!-- This can be done by touching the web.config or recycling the application pool -->
<tinymceConfig>
  <commands>
    <command>
      <umbracoAlias>code</umbracoAlias>
      <name>Code</name>
      <icon>images/editor/code.gif</icon>
      <tinyMceCommand value="" userInterface="false" frontendCommand="code">code</tinyMceCommand>
      <priority>1</priority>
    </command>
    <command>
      <umbracoAlias>codemirror</umbracoAlias>
      <name>Code mirror</name>
      <icon>images/editor/code.gif</icon>
      <tinyMceCommand value="" userInterface="false" frontendCommand="codemirror">codemirror</tinyMceCommand>
      <priority>1</priority>
    </command>
    <command>
      <umbracoAlias>removeformat</umbracoAlias>
      <name>Remove format</name>
      <icon>images/editor/removeformat.gif</icon>
      <tinyMceCommand value="" userInterface="false" frontendCommand="removeformat">removeformat</tinyMceCommand>
      <priority>2</priority>
    </command>
    <command>
      <umbracoAlias>undo</umbracoAlias>
      <name>Undo</name>
      <name>Remove Format</name>
      <icon>images/editor/undo.gif</icon>
      <tinyMceCommand value="" userInterface="false" frontendCommand="undo">undo</tinyMceCommand>
      <priority>11</priority>
    </command>
    <command>
      <umbracoAlias>redo</umbracoAlias>
      <name>Redo</name>
      <icon>images/editor/redo.gif</icon>
      <tinyMceCommand value="" userInterface="false" frontendCommand="redo">redo</tinyMceCommand>
      <priority>12</priority>
    </command>
    <command>
      <umbracoAlias>cut</umbracoAlias>
      <name>Cut</name>
      <icon>images/editor/cut.gif</icon>
      <tinyMceCommand value="" userInterface="false" frontendCommand="cut">cut</tinyMceCommand>
      <priority>13</priority>
    </command>
    <command>
      <umbracoAlias>copy</umbracoAlias>
      <name>Copy</name>
      <icon>images/editor/copy.gif</icon>
      <tinyMceCommand value="" userInterface="false" frontendCommand="copy">copy</tinyMceCommand>
      <priority>14</priority>
    </command>
    <command>
      <umbracoAlias>paste</umbracoAlias>
      <name>Paste</name>
      <icon>images/editor/paste.gif</icon>
      <tinyMceCommand value="" userInterface="false" frontendCommand="paste">paste</tinyMceCommand>
      <priority>15</priority>
    </command>
    <command>
      <umbracoAlias>styleselect</umbracoAlias>
      <name>Style select</name>
      <icon>images/editor/showStyles.png</icon>
      <tinyMceCommand value="" userInterface="false" frontendCommand="styleselect">styleselect</tinyMceCommand>
      <priority>20</priority>
    </command>
    <command>
      <umbracoAlias>bold</umbracoAlias>
      <name>Bold</name>
      <icon>images/editor/bold.gif</icon>
      <tinyMceCommand value="" userInterface="false" frontendCommand="bold">bold</tinyMceCommand>
      <priority>21</priority>
    </command>
    <command>
      <umbracoAlias>italic</umbracoAlias>
      <name>Italic</name>
      <icon>images/editor/italic.gif</icon>
      <tinyMceCommand value="" userInterface="false" frontendCommand="italic">italic</tinyMceCommand>
      <priority>22</priority>
    </command>
    <command>
      <umbracoAlias>underline</umbracoAlias>
      <name>Underline</name>
      <icon>images/editor/underline.gif</icon>
      <tinyMceCommand value="" userInterface="false" frontendCommand="underline">underline</tinyMceCommand>
      <priority>23</priority>
    </command>
    <command>
      <umbracoAlias>strikethrough</umbracoAlias>
      <name>Strikethrough</name>
      <icon>images/editor/strikethrough.gif</icon>
      <tinyMceCommand value="" userInterface="false" frontendCommand="strikethrough">strikethrough</tinyMceCommand>
      <priority>24</priority>
    </command>
    <command>
      <umbracoAlias>justifyleft</umbracoAlias>
      <name>Justify left</name>
      <icon>images/editor/justifyleft.gif</icon>
      <tinyMceCommand value="" userInterface="false" frontendCommand="alignleft">justifyleft</tinyMceCommand>
      <priority>31</priority>
    </command>
    <command>
      <umbracoAlias>justifycenter</umbracoAlias>
      <name>Justify center</name>
      <icon>images/editor/justifycenter.gif</icon>
      <tinyMceCommand value="" userInterface="false" frontendCommand="aligncenter">justifycenter</tinyMceCommand>
      <priority>32</priority>
    </command>
    <command>
      <umbracoAlias>justifyright</umbracoAlias>
      <name>Justify right</name>
      <icon>images/editor/justifyright.gif</icon>
      <tinyMceCommand value="" userInterface="false" frontendCommand="alignright">justifyright</tinyMceCommand>
      <priority>33</priority>
    </command>
    <command>
      <umbracoAlias>justifyfull</umbracoAlias>
      <name>Justify full</name>
      <icon>images/editor/justifyfull.gif</icon>
      <tinyMceCommand value="" userInterface="false" frontendCommand="alignjustify">alignjustify</tinyMceCommand>
      <priority>34</priority>
    </command>
    <command>
      <umbracoAlias>bullist</umbracoAlias>
      <name>Bullet list</name>
      <icon>images/editor/bullist.gif</icon>
      <tinyMceCommand value="" userInterface="false" frontendCommand="bullist">bullist</tinyMceCommand>
      <priority>41</priority>
    </command>
    <command>
      <umbracoAlias>numlist</umbracoAlias>
      <name>Numbered list</name>
      <icon>images/editor/numlist.gif</icon>
      <tinyMceCommand value="" userInterface="false" frontendCommand="numlist">numlist</tinyMceCommand>
      <priority>42</priority>
    </command>
    <command>
      <umbracoAlias>outdent</umbracoAlias>
      <name>Decrease indent</name>
      <icon>images/editor/outdent.gif</icon>
      <tinyMceCommand value="" userInterface="false" frontendCommand="outdent">outdent</tinyMceCommand>
      <priority>43</priority>
    </command>
    <command>
      <umbracoAlias>indent</umbracoAlias>
      <name>Increase indent</name>
      <icon>images/editor/indent.gif</icon>
      <tinyMceCommand value="" userInterface="false" frontendCommand="indent">indent</tinyMceCommand>
      <priority>44</priority>
    </command>
    <command>
      <umbracoAlias>mceLink</umbracoAlias>
      <name>Insert/edit link</name>
      <icon>images/editor/link.gif</icon>
      <tinyMceCommand value="" userInterface="true" frontendCommand="link">link</tinyMceCommand>
      <priority>51</priority>
    </command>
    <command>
      <umbracoAlias>unlink</umbracoAlias>
      <name>Remove link</name>
      <icon>images/editor/unLink.gif</icon>
      <tinyMceCommand value="" userInterface="false" frontendCommand="unlink">unlink</tinyMceCommand>
      <priority>52</priority>
    </command>
    <command>
      <umbracoAlias>mceInsertAnchor</umbracoAlias>
      <name>Anchor</name>
      <icon>images/editor/anchor.gif</icon>
      <tinyMceCommand value="" userInterface="false" frontendCommand="anchor">anchor</tinyMceCommand>
      <priority>53</priority>
    </command>
    <command>
      <umbracoAlias>mceImage</umbracoAlias>
      <name>Image</name>
      <icon>images/editor/image.gif</icon>
      <tinyMceCommand value="" userInterface="true" frontendCommand="umbmediapicker">image</tinyMceCommand>
      <priority>61</priority>
    </command>
    <command>
      <umbracoAlias>umbracomacro</umbracoAlias>
      <name>Macro</name>
      <icon>images/editor/insMacro.gif</icon>
      <tinyMceCommand value="" userInterface="true" frontendCommand="umbmacro">umbracomacro</tinyMceCommand>
      <priority>62</priority>
    </command>
    <command>
      <umbracoAlias>mceInsertTable</umbracoAlias>
      <name>Table</name>
      <icon>images/editor/table.gif</icon>
      <tinyMceCommand value="" userInterface="true" frontendCommand="table">table</tinyMceCommand>
      <priority>63</priority>
    </command>
    <command>
      <umbracoAlias>umbracoembed</umbracoAlias>
      <name>Embed</name>
      <icon>images/editor/media.gif</icon>
      <tinyMceCommand value="" userInterface="true" frontendCommand="umbembeddialog">umbracoembed</tinyMceCommand>
      <priority>66</priority>
    </command>
    <command>
      <umbracoAlias>inserthorizontalrule</umbracoAlias>
      <name>Horizontal rule</name>
      <icon>images/editor/hr.gif</icon>
      <tinyMceCommand value="" userInterface="false" frontendCommand="hr">hr</tinyMceCommand>
      <priority>71</priority>
    </command>
    <command>
      <umbracoAlias>subscript</umbracoAlias>
      <name>Subscript</name>
      <icon>images/editor/sub.gif</icon>
      <tinyMceCommand value="" userInterface="false" frontendCommand="subscript">subscript</tinyMceCommand>
      <priority>72</priority>
    </command>
    <command>
      <umbracoAlias>superscript</umbracoAlias>
      <name>Superscript</name>
      <icon>images/editor/sup.gif</icon>
      <tinyMceCommand value="" userInterface="false" frontendCommand="superscript">superscript</tinyMceCommand>
      <priority>73</priority>
    </command>
    <command>
      <umbracoAlias>mceCharMap</umbracoAlias>
      <name>Character map</name>
      <icon>images/editor/charmap.gif</icon>
      <tinyMceCommand value="" userInterface="false" frontendCommand="charmap">charmap</tinyMceCommand>
      <priority>74</priority>
    </command>
  </commands>
  <plugins>
    <plugin loadOnFrontend="true">code</plugin>
    <plugin loadOnFrontend="true">codemirror</plugin>
    <plugin loadOnFrontend="true">paste</plugin>
    <plugin loadOnFrontend="true">umbracolink</plugin>
    <plugin loadOnFrontend="true">anchor</plugin>
    <plugin loadOnFrontend="true">charmap</plugin>
    <plugin loadOnFrontend="true">table</plugin>
    <plugin loadOnFrontend="true">lists</plugin>
    <plugin loadOnFrontend="true">hr</plugin>
  </plugins>
  <validElements>
    <![CDATA[+a[id|style|rel|data-id|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick|
ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],-strong/-b[class|style],-em/-i[class|style],
-strike[class|style],-u[class|style],#p[id|style|dir|class|align],-ol[class|reversed|start|style|type],-ul[class|style],-li[class|style],br[class],
img[id|dir|lang|longdesc|usemap|style|class|src|onmouseover|onmouseout|border|alt=|title|hspace|vspace|width|height|align|umbracoorgwidth|umbracoorgheight|onresize|onresizestart|onresizeend|rel|data-id],
-sub[style|class],-sup[style|class],-blockquote[dir|style|class],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|style|dir|id|lang|bgcolor|background|bordercolor],
-enter code heretr[id|lang|dir|class|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor],tbody[id|class],
thead[id|class],tfoot[id|class],#td[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor|scope],
-th[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|scope],caption[id|lang|dir|class|style],-div[id|dir|class|align|style],
-span[class|align|style],-pre[class|align|style],address[class|align|style],-h1[id|dir|class|align|style],-h2[id|dir|class|align|style],
-h3[id|dir|class|align|style],-h4[id|dir|class|align|style],-h5[id|dir|class|align|style],-h6[id|style|dir|class|align|style],hr[class|style],
dd[id|class|title|style|dir|lang],dl[id|class|title|style|dir|lang],dt[id|class|title|style|dir|lang],object[class|id|width|height|codebase|*],
param[name|value|_value|class],embed[type|width|height|src|class|*],map[name|class],area[shape|coords|href|alt|target|class],bdo[class],button[class],iframe[*]]]>
  </validElements>
  <invalidElements>font</invalidElements>

  <!-- this area is for custom config settings that should be added during TinyMCE initialization -->
  <customConfig>
    <!--    <config key="myKey">mySetting</config>-->
    <config key="entity_encoding">raw</config>
    <config key="codemirror">
      {
      "indentOnInit": false,
      "path": "../../../../lib/codemirror",
      "config": {
      },
      "jsFiles": [
      ],
      "cssFiles": [
      ]
      }
    </config>
  </customConfig>
</tinymceConfig>

1 个答案:

答案 0 :(得分:0)

@Marty你的文件与我的相比有1个不同。见附图。 删除文本“在此输入代码”,然后重试或再次下载该文件。

请确保您回收AppPool以确保其提取配置更改。enter image description here