Opened 12 years ago
Closed 12 years ago
#2317 closed defect (bug) (fixed)
bbPress Posting Codes Bugs
Reported by: | alex-ye | Owned by: | |
---|---|---|---|
Milestone: | 2.3.2 | Priority: | high |
Severity: | normal | Version: | 2.3.1 |
Component: | General - Content Creation | Keywords: | needs-patch dev-feedback |
Cc: | nashwan.doaqan@… |
Description
1- The codes doesn't displayed correctly in the edit screens:
Original source code:
<pre><code><p>bbPress <b>2.3.1</b>.</p></code></pre>
Viewing source Code (Good):
<pre><code><p>bbPress <b>2.3.1</b>.</p></code></pre>
Edit-sceen source code (not-good):
'<p>bbPress <b>2.3.1</b>.</p>'
After save the edit-screen code (not-good):
<code><p>bbPress <b>2.3.1</b>.</p></code>
The codes in the edit-screens must be displayed the same as the original code.
2- Posting codes by admins, not a good experience:
The users who have the 'unfiltered_html' capability, should be able to use all HTML tags without decoding them except those tags inside <pre><code> </code><pre>
3- Codes inside codes !
Try to post this code:
Original source code:
<code><code><b>bbPress</b></code></code>
Edit-screen source code (not-good):
'<code><b>bbPress</b>'</code>
View source code (not-good):
<code></code><code><b>bbPress</b></code>
4- Smiles Inside codes:
When you post a smile symbol like " :) ", it should displayed as it's and not converted to an image.
5- Anchors\Links inside codes:
When you post an anchor tag, It should displayed as it's and not converted to a link.
Original source code:
<pre><code><a href="http://google.com">Google</a></code></pre>
View source code (not-good):
<pre><code><a href="http://google.com" rel="nofollow">Google</a></code></pre>
6- ' or <code> , What's the rule?!
I notice that you convert the <code> tags to markdown ' symbol but I can't realized Why? and When? and how I can disable this?
Attachments (1)
Change History (18)
#2
in reply to:
↑ 1
;
follow-up:
↓ 4
@
12 years ago
Replying to johnjamesjacoby:
I'm not able to duplicate this. It seems to work okay.
Wired?! , What I meant that the
<pre><code>bbPress</code></pre>
converted to backticks only
'bbPress'
It should converted to:
<pre>'bbPress'</pre>
Right?
#3
in reply to:
↑ 1
@
12 years ago
Replying to johnjamesjacoby:
Able to reproduce, and will be hard to prevent. Should look into this in 2.4.
I think it will be kind of hack, but it's possible, I will try to upload a patch.
If you use backticks, this doesn't happen. Maybe the make_clickable filter is out of order.
Sure thing it's about make_clickable() I create a ticket in the WordPress
http://core.trac.wordpress.org/ticket/23756
but I am not good in patterns to fix it :D
Another question related to this topic why bbPress convert the <p>,<br /> to <coded p>, I think the reason around wpautop but if you can post more explanation?
#4
in reply to:
↑ 2
;
follow-up:
↓ 5
@
12 years ago
Replying to alex-ye:
Right?
<pre> tags are block level elements. If you put your code blocks on their own lines, they'll act as such. If you keep them inline with other text, it will display only with code tags, and not with pre tags.
#5
in reply to:
↑ 4
@
12 years ago
Replying to johnjamesjacoby:
<pre> tags are block level elements. If you put your code blocks on their own lines, they'll act as such. If you keep them inline with other text, it will display only with code tags, and not with pre tags.
Got it, but I think it still there some bugs around this, It's about the change before/after save if the <pre> must be in multi-line
so when you post
<pre><code>bbPress</code></pre>
It should be converted to:
<code>bbPress</code>
immediately.
and when you post this:
<pre><code> <?php echo "Hi"; ?> </code></pre>
it should be displayed as below in the edit-screen
<pre>' <?php echo "Hi"; ?> '</pre>
#6
follow-up:
↓ 7
@
12 years ago
You're misunderstanding what backticks do. Backticks are like "smart code tags" that convert pre/code tags to backticks if you use them pre-save, and then format them correctly on output.
They don't only convert <code> tags, rather they convert all usages of <code> and <pre> and then format the output as needed.
#7
in reply to:
↑ 6
@
12 years ago
Replying to johnjamesjacoby:
You're misunderstanding what backticks do. Backticks are like "smart code tags" that convert pre/code tags to backticks if you use them pre-save, and then format them correctly on output.
They don't only convert <code> tags, rather they convert all usages of <code> and <pre> and then format the output as needed.
aha, I think I understand it a little bit now, I will do some tests to make sure I get the idea .
#9
@
12 years ago
Confirmed, bbPress backticks are really smart feature, a less-headache when posting code , I was usually using pre/code tags so it make me confuse.
Anyway.. waiting for someone help to solve the listed bugs above.
#10
@
12 years ago
note: a bug noticed here
http://bbpress.org/forums/topic/bbpress-2-3-1-now-available/#post-133805
Replying to alex-ye:
The conversion to backticks is by design.
I'm not able to duplicate this. It seems to work okay.
This valid. I saw the other ticket (#2315) about this, so let's address this there.
Valid, and the main reason to use backticks from the start instead of wrapping in pre and code tags.
Able to reproduce, and will be hard to prevent. Should look into this in 2.4.
If you use backticks, this doesn't happen. Maybe the make_clickable filter is out of order.
This is the way bbPress originally worked. We didn't implement it in bbPress 2.0, but brought it back in 2.3. Because of most of the issues you've posted above, I'd recommend not trying to disable them, or helping improve the nesting of code tags in core where backticks aren't necessary.