[wp-trac] [WordPress Trac] #27148: comments in page code converted to displayed text upon submission

WordPress Trac noreply at wordpress.org
Wed Feb 19 07:24:50 UTC 2014


#27148: comments in page code converted to displayed text upon submission
-------------------------------+------------------------------
 Reporter:  wchapin            |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Formatting         |     Version:
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by wchapin):

 First of all, I cannot duplicate the behavior within creating a post, only
 on editing a page.  The HTML comment works as expected within a post.

 Second point is that an inline comment outside of other HTML tags works as
 expected.

 When editing a page I entered the following in text view:
 ======================
 <ol>
         <li>Point number 1</li>
         <li>Point number 2</li>
         <li>Point number 3</li>
         <li>Point number 4</li>
         <li>Point number 5</li>
 </ol>
 ======================
 I want to comment out one of the list items, but save it to enable it
 later.  So I create the following code:
 ======================
 <ol>
         <li>Point number 1</li>
         <li>Point number 2</li>
 <!--
         <li>Point number 3</li>
 -->
         <li>Point number 4</li>
         <li>Point number 5</li>
 </ol>
 ======================
 This evening I get different behavior than this morning.
 Prior to this evening, when I switched to "visual" view, I got what I
 expected.  However, when I posted, the "<!--" was converted to "<!--"
 and the "-->" converted to "-->" and all text was presented literally.

 Now, when I switch to "visual" view, the code converts to this:
 ======================
 <ol>
 <ol>
         <li>Point number 1</li>
         <li>Point number 2</li>
 </ol>
 </ol>
 <!--
         <li>Point number 3</li>
 -->
 <ol>
         <li>Point number 4</li>
         <li>Point number 5</li>
 </ol>
 ======================
 And the display is what you would expect from that ... two lists of
 different depths.  But this is not what is desired.

 If it is posted directly, without switching to visual view first, I get
 the following:
 ======================
 <ol>
         <li>Point number 1</li>
         <li>Point number 2</li>
 <!--
         <li>Point number 3</li>
 -->
         <li>Point number 4</li>
         <li>Point number 5</li>
 </ol>
 ======================

 My test blog is at
 [http://wlcbugs.wordpress.com/about]
 Follow my procedure above in my first comment to edit a page on a WP site.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/27148#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list