Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
BBCode Quote tags truncate leading spaces on a line [Solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo Forums Feedback
View previous topic :: View next topic  
Author Message
Fitzcarraldo
Advocate
Advocate


Joined: 30 Aug 2008
Posts: 2034
Location: United Kingdom

PostPosted: Sat Aug 12, 2017 12:37 am    Post subject: BBCode Quote tags truncate leading spaces on a line [Solved] Reply with quote

Is there a proper way to stop BBCode Quote tags in Gentoo Forums posts from dropping leading spaces? For example, the lines quoted below actually have the number of leading spaces mentioned, but these spaces are not displayed.

Quote:
There are no leading spaces on this line.
There is 1 leading space on this line.
There are 2 leading spaces in this line.
There are 3 leading spaces on this line.
There are 4 leading spaces on this line.
There are 5 leading spaces on this line.


The only way I have found to make the lines look correct when the post is submitted is to replace each leading space with an em-space which I produced by using the HTML entity   in the w3schools.com Tryit Editor and copy-pasting it into the quote:

Quote:
There are no leading spaces on this line.
 There is 1 leading space on this line.
  There are 2 leading spaces in this line.
   There are 3 leading spaces on this line.
    There are 4 leading spaces on this line.
     There are 5 leading spaces on this line.

You can select the em-spaces above with your mouse. As you can see above, an em-space is not the width of a real space, but at least the use of em-spaces enables indentation at the beginning of a line inside Quote tags.

Is that the only was to indent text inside Quote tags in phpBB 2.0.23-gentoo-p11, or is there a better way?
_________________
Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC udev elogind & KDE on both.

Fitzcarraldo's blog


Last edited by Fitzcarraldo on Sat Aug 12, 2017 12:54 pm; edited 1 time in total
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9645
Location: almost Mile High in the USA

PostPosted: Sat Aug 12, 2017 12:47 am    Post subject: Reply with quote

Those quote blocks are in variable width font anyway, so no guarantees on space width...
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3104

PostPosted: Sat Aug 12, 2017 8:26 am    Post subject: Reply with quote

0 spaces
1 space
2 spaces
3 spaces
Code:

0 spaces
 1 space
  2 spaces
   3 spaces


Use code for monospace font without trimming leading/multiple spaces.
Quote works exactly the same way as regular text (safe for drawing a block around it) so it's working-as-intended™
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10587
Location: Somewhere over Atlanta, Georgia

PostPosted: Sat Aug 12, 2017 12:18 pm    Post subject: Re: BBCode Quote tags truncate leading spaces on a line Reply with quote

Fitzcarraldo wrote:
... As you can see above, an em-space is not the width of a real space, but at least the use of em-spaces enables indentation at the beginning of a line inside Quote tags. ...
Answering for the current phpBB code base, that's the only way, but there are better Unicode choices, the best of which is probably U+2004 (Three-Per-Em Space). Behold:
Zero
 One
  Two
   Three
    Four

Alas, U+00A0 (Non-Break Space) is eaten by phpBB.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
Fitzcarraldo
Advocate
Advocate


Joined: 30 Aug 2008
Posts: 2034
Location: United Kingdom

PostPosted: Sat Aug 12, 2017 12:53 pm    Post subject: Reply with quote

Thanks. The reason I asked was in case there was a BBCode tag for these specific forums I didn't know about, as I know some phpBB forums support BBCode tags such as [Tab]{NUMBER}[/Tab] within Quote tags. Good idea to use a three-per-em space rather than an em space, John. I'll use those when I want to emulate spaces at the beginning of lines within Quote tags, as putting quotes within Code tags just looks naff to me:

Arch Wiki wrote:
Tables

iptables contains five tables:

    1. raw is used only for configuring packets so that they are exempt from connection tracking.
    2. filter is the default table, and is where all the actions typically associated with a firewall take place.
    3. nat is used for network address translation (e.g. port forwarding).
    4. mangle is used for specialized packet alterations.
    5. security is used for Mandatory Access Control networking rules (e.g. SELinux -- see this article for more details).

In most common use cases you will only use two of these: filter and nat. The other tables are aimed at complex configurations involving multiple routers and routing decisions and are in any case beyond the scope of these introductory remarks.

Code:
Tables

iptables contains five tables:

    1. raw is used only for configuring packets so that they are exempt from connection tracking.
    2. filter is the default table, and is where all the actions typically associated with a firewall take place.
    3. nat is used for network address translation (e.g. port forwarding).
    4. mangle is used for specialized packet alterations.
    5. security is used for Mandatory Access Control networking rules (e.g. SELinux -- see this article for more details).

In most common use cases you will only use two of these: filter and nat. The other tables are aimed at complex configurations involving multiple routers and routing decisions and are in any case beyond the scope of these introductory remarks.

_________________
Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC udev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10587
Location: Somewhere over Atlanta, Georgia

PostPosted: Sat Aug 12, 2017 1:13 pm    Post subject: Reply with quote

At least for that example, there are better native BBCode methods:

A numbered list that properly justifies:
  1. The quick brown fox jumped over the lazy dog. Mother very thoughtfully made a jelly sandwich under no protest. It's hard to be a larvae. It was the best of times, it was the worst of times. The man on the moon was dead. Like a glowing jewel, the city lay upon the breast of the desert.
  2. Another item.
An example of indented text, also properly justified:
    The quick brown fox jumped over the lazy dog. Mother very thoughtfully made a jelly sandwich under no protest. It's hard to be a larvae. It was the best of times, it was the worst of times. The man on the moon was dead. Like a glowing jewel, the city lay upon the breast of the desert.
      The quick brown fox jumped over the lazy dog. Mother very thoughtfully made a jelly sandwich under no protest. It's hard to be a larvae. It was the best of times, it was the worst of times. The man on the moon was dead. Like a glowing jewel, the city lay upon the breast of the desert.
- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Forums Feedback All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum