crowdfavorite / wp-capsule

The developer's code journal (built on WordPress)
https://crowdfavorite.com/capsule/
GNU General Public License v2.0
172 stars 27 forks source link

PHP fenced code partially omitted from displayed code #26

Closed dixonge closed 4 years ago

dixonge commented 11 years ago

Here is the first part of the code as pasted into the entry:

PHP code for 5 divs

[triple-tick here] php
<?php
    // Get first post
    global $post;
    $args = array( 'numberposts' => 1, 'order' =>'DESC' );

Here is how the first four lines are actually displaying

image

As you can see, the first 3.5 lines of PHP code isn't displaying, but is actually in the post.

alexkingorg commented 11 years ago

Cannot reproduce, likely related to #15

dixonge commented 11 years ago

I should add that this capsule post is rather lengthy. The first half is a title, a link and a fenced section of javascript code. That part displays fine. Then I have one line of text and a fenced section of php code. Only the first 3.5 lines of fenced PHP code are not displaying after saving. Evidently it is hiding everything from the opening <?php statement up until the first '>' closing bracket. I have also been unable to reliably reproduce this using small code samples.

alexkingorg commented 11 years ago

Please update this ticket when you have a reproducible content example.

dixonge commented 11 years ago

ok, I ran into this again and reduced the code down to a snippet that I can paste into a new capsule item and it hides part of the code every time. Here is the snippet:

## Test Title
@PHP

``` php
<?php
$whole = $partial->get_item_quantity(4);
?>
(with a closing triple-tick, even though it isn't displaying here on GitHub)

In this example, after I close the editing window, the code display begins with "get_item_quantity" - obviously it is hiding everything between the opening PHP operator and the -> in the main line of code. This happens no matter how much other PHP code surrounds these lines.
alexkingorg commented 11 years ago

Seems to work fine for me using latest in the develop branch:

http://d.pr/i/49bx http://d.pr/i/YfBF

dixonge commented 4 years ago

I think that, after seven years, it's safe to go ahead and close this issue! LOL