PHPBB3-14844 - BBcode on style inherit from prosilver

Discuss requests for comments/changes posted in the Issue Tracker for the development of phpBB. Current releases are 3.2/Rhea and 3.3/Proteus.
Jester-fr
Registered User
Posts: 6
Joined: Sun Oct 30, 2016 2:19 pm

PHPBB3-14844 - BBcode on style inherit from prosilver

Post by Jester-fr »

Hi there,

one of our team member have noticed a little bug with BBcode and forum description (only on style inherit from prosilver).
If you use a BBcode b and color on the description, no problem in ACP. HTML result :

Code: Select all

<span style="font-weight: bold;">
    <span style="color: #FF0000">Description du forum</span>
</span>
or

Code: Select all

<span style="color: #FF0000">
    <span style="font-weight: bold;">Description du forum</span>
</span>
HTML on style inherit on prosilver :

Code: Select all

<span style="color: #FF0000">
    <strong>Description du forum</strong>
</span>
or

Code: Select all

<strong>
    <span style="color: #FF0000">Description du forum</span>
</strong>
the <strong> is outpassed by CSS lines :

Code: Select all

li.row strong {
    color: #000000;
}
and

Code: Select all

li.row strong {
    font-weight: normal;
}
To resolve it, bbcode.html can be modified :

Find :

Code: Select all

<!-- BEGIN b_open --><strong><!-- END b_open -->
<!-- BEGIN b_close --></strong><!-- END b_close -->
Replace by :

Code: Select all

<!-- BEGIN b_open --><span style="font-weight: bold;"><!-- END b_open -->
<!-- BEGIN b_close --></span><!-- END b_close -->
(<strong> tag defines strong emphasized text, but in HTML5 it defines important text.).

Is it right ?
Last edited by Jester-fr on Tue Nov 01, 2016 4:11 pm, edited 4 times in total.

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1903
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: BBcode and forum description on style inherit from prosilver

Post by DavidIQ »

The question I would have is why are we going out of our way to make strong tags NOT be bold and then overriding the color?
hanakin wrote:poke
Image

Jester-fr
Registered User
Posts: 6
Joined: Sun Oct 30, 2016 2:19 pm

Re: BBcode and forum description on style inherit from prosilver

Post by Jester-fr »

Because it's a semantic issue ?
strong tags are not designed to format the text. They're only there to define important text, especially in a HTML5 context.
http://www.w3schools.com/tags/tag_strong.asp

User avatar
hanakin
Front-End Dev Team Lead
Front-End Dev Team Lead
Posts: 968
Joined: Sat Dec 25, 2010 9:02 pm
Contact:

Re: BBcode and forum description on style inherit from prosilver

Post by hanakin »

@david

that code prevents html from altering the title appearance on a row in viewforum not the post. It is sort of overqualified as all prosilver code is but should have no affect on the post. Not sure why he is using BBcode in the title anyway!!
Donations welcome via Paypal Image

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1903
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: BBcode and forum description on style inherit from prosilver

Post by DavidIQ »

hanakin wrote: Sun Oct 30, 2016 10:21 pm @david

that code prevents html from altering the title appearance on a row in viewforum not the post. It is sort of overqualified as all prosilver code is but should have no affect on the post. Not sure why he is using BBcode in the title anyway!!
He's not using it in the title. He's using it in the forum description. If it's just for the title then perhaps this: li.row strong should be this? li.row a strong
Image

cabot
Registered User
Posts: 8
Joined: Sun Jun 02, 2013 11:15 am

Re: BBcode and forum description on style inherit from prosilver

Post by cabot »

Hello,

It's not a styling issue, you can customize the strong tag with all the CSS properties you want. As browsers display the strong tag as they decide (bold, pink, or with a yellow background if they want) but this does not affect the semantic content of this tag.

bold style != strong tag

So this is not correct in bbcodes.html file :

Code: Select all

<!-- BEGIN b_open --><strong><!-- END b_open -->
<!-- BEGIN b_close --></strong><!-- END b_close -->
It should use this HTML structure :

Code: Select all

<!-- BEGIN b_open --><span style="font-weight: bold;"><!-- END b_open -->
<!-- BEGIN b_close --></span><!-- END b_close -->
Ps : sorry for my english, I'm french and I use google translate. :oops:

User avatar
hanakin
Front-End Dev Team Lead
Front-End Dev Team Lead
Posts: 968
Joined: Sat Dec 25, 2010 9:02 pm
Contact:

Re: BBcode and forum description on style inherit from prosilver

Post by hanakin »

not entirely true while yes I see your point that the styling should be applied via css and you might not intend all to be strong semantically; sometimes you do want to apply emphasis in an a post on a forum which you want to be semantic for seo reasons. You can not do this with css which is why they went with strong and em which is also used.

Either way that code is far to verbose and overqualified it should just be a single css class and not affect any of the base html

Code: Select all

.forum-desc


for several reasons, but again thats all of prosilver. Either way its a BC if we add a new class we also need to add a p tag around the desc as its free text within the inner at the moment, so it would have to wait until 3.3

Code: Select all

<li class="row">
	<dl class="row-item {forumrow.FORUM_IMG_STYLE}">
		<dt title="{forumrow.FORUM_FOLDER_IMG_ALT}">
			<a href="{forumrow.U_VIEWFORUM}" class="row-item-link"></a>
			<div class="list-inner">
				<span class="forum-image">{forumrow.FORUM_IMAGE}</span>
				<a href="{forumrow.U_VIEWFORUM}" class="forumtitle">{forumrow.FORUM_NAME}</a>
				<br />
				{forumrow.FORUM_DESC}
			</div>
		</dt>
	</dl>
</li>
we could apply it temporarily to the inner and reverse it on the forumtitle...
Donations welcome via Paypal Image

cabot
Registered User
Posts: 8
Joined: Sun Jun 02, 2013 11:15 am

Re: BBcode and forum description on style inherit from prosilver

Post by cabot »

In fact, the problem raised is not about the styling of the strong tag neither the .forumtitle item, but about the replacing of the code returned on the BBCode b by a strong tag in the bbcodes.html file.

When this file is used, it replacing <span style="font-weight: bold"></span> by <strong><strong>, it's not correct.

Please, try to add bold style in a forum description and have a look at the code, it's ok with prosilver (span with style attribute) but when using another style which inherit, you will see the issue (strong tag). This issue is because the bbcodes.html file replace span/style by a strong tag.

User avatar
hanakin
Front-End Dev Team Lead
Front-End Dev Team Lead
Posts: 968
Joined: Sat Dec 25, 2010 9:02 pm
Contact:

Re: BBcode and forum description on style inherit from prosilver

Post by hanakin »

the issue is not that simple as I have stated. the easiest fix for now is to add

Code: Select all

style="font-weight: bold; color: inherit;"
to the current strong tag to handle this minor edge case. the strong tag is correct and used properly. as is the em tag . In fact the entirety of bbcodes needs overhauled in core as the text sizes should reflect proper h tags as well for proper seo...

the

Code: Select all

li.row strong {
    color: #000000;
}

li.row strong {
    color: font-weight: normal;
}
is far more problematic than i originally thought as li.row is a massively overused parent in every template file from forums to topics to ucp to mcp (23 found in 17 files) and there are hundreds of strong tags in all of them...
Donations welcome via Paypal Image

cabot
Registered User
Posts: 8
Joined: Sun Jun 02, 2013 11:15 am

Re: BBcode and forum description on style inherit from prosilver

Post by cabot »

I think we do not understand. :oops:

BBCode b in bbcode.php :

Code: Select all

'b_open'	=> '<span style="font-weight: bold">',
'b_close'	=> '</span>',
BBCode b in bbcode.html :

Code: Select all

<!-- BEGIN b_open --><strong><!-- END b_open -->
<!-- BEGIN b_close --></strong><!-- END b_close -->
Either it is considered that the BBCode b returns bold text, or it is considered that it returns a strong tag. But it is not correct to transform the expected code according to the used file.

Post Reply