LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > LinuxQuestions.org > LQ Suggestions & Feedback
User Name
Password
LQ Suggestions & Feedback Do you have a suggestion for this site or an idea that will make the site better? This forum is for you.
PLEASE READ THIS FORUM - Information and status updates will also be posted here.

Notices


Reply
  Search this Thread
Old 12-07-2019, 08:38 PM   #1
dogpatch
Member
 
Registered: Nov 2005
Location: Central America
Distribution: Mepis, Android
Posts: 490
Blog Entries: 4

Rep: Reputation: 238Reputation: 238Reputation: 238
how to print an ampersand in posts and comments


In this thread (2nd post), I can't answer the OPs question because i can't get an ampersand to print, either within [CODE] tags or otherwise.

I would like to print [ampersand]#10; to designate one way to represent a newline character.

If i use '&' to print an ampersand, i get '&' literally; the initial ampersand doesn't get interpreted.

If i use [ampersand]#38; to print an ampersand, it interprets the ampersand AND the following '#10;', and i get nothing but a whitespace.
 
Old 12-08-2019, 04:56 AM   #2
petelq
Member
 
Registered: Aug 2008
Location: Yorkshire
Distribution: openSUSE(Leap and Tumbleweed) and a (not so) regularly changing third and fourth
Posts: 627

Rep: Reputation: Disabled
Is this serious? Your post clearly shows 2 ampersands.
 
Old 12-08-2019, 04:59 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,692

Rep: Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274
you need to understand how BB codes work: https://www.linuxquestions.org/quest....php?do=bbcode (not so trivial)
[noparse]&[/noparse] should work
 
1 members found this post helpful.
Old 12-08-2019, 06:02 AM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,877
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Why does it need any bbcodes?

Perhaps we don't understand the problem?

Ampersand? That is & ?

And the problem is having it show in an LQ post?

What does happen instead?
 
Old 12-08-2019, 08:23 AM   #5
dogpatch
Member
 
Registered: Nov 2005
Location: Central America
Distribution: Mepis, Android
Posts: 490

Original Poster
Blog Entries: 4

Rep: Reputation: 238Reputation: 238Reputation: 238
OK, let me try pan64's advice:

Code:


I used the 'noparse' tag to print the above; that seems to work. I had been trying to use '&', or '&', which gave me unexpected results.

thanks, pan64!

Last edited by dogpatch; 12-08-2019 at 08:34 AM. Reason: added verification and thanks
 
Old 12-08-2019, 09:42 AM   #6
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,770

Rep: Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210
Quote:
Originally Posted by dogpatch View Post
OK, let me try pan64's advice:

Code:


I used the 'noparse' tag to print the above; that seems to work. I had been trying to use '&', or '&', which gave me unexpected results.

thanks, pan64!
Actually, anything between the "&" and the "#10" will solve the problem. Here I will just make the "&" bold, and &#10 behaves just fine. So does an empty bold string there (&[B][/B]#10): &#10.

Without something to break up that sequence, parts of the editor treat that as a character code in decimal.
 
Old 12-08-2019, 10:03 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,692

Rep: Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274
I would say OP mixed the html (or whatever) codes and BB codes. This board uses BB codes and no need to use HTML codes (or anything else).
 
1 members found this post helpful.
Old 12-13-2019, 05:18 PM   #8
dogpatch
Member
 
Registered: Nov 2005
Location: Central America
Distribution: Mepis, Android
Posts: 490

Original Poster
Blog Entries: 4

Rep: Reputation: 238Reputation: 238Reputation: 238
Quote:
Originally Posted by pan64 View Post
I would say OP mixed the html (or whatever) codes and BB codes. This board uses BB codes and no need to use HTML codes (or anything else).
Guess that explains it. What threw me off was that some ampersand tags seem to work in LQ posts. Anyway, now i know.
 
  


Reply

Tags
ampersand


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: And, Ampersand, and & in Linux LXer Syndicated Linux News 0 02-07-2019 08:31 AM
ampersand problem in cgi script... Sherlock Programming 1 05-22-2007 07:42 AM
ampersand problem in cgi script... Sherlock Programming 6 05-22-2007 02:12 AM
pdftotext - How to output to html with ampersand entities ? narc Linux - Software 2 01-04-2006 02:34 PM
alternative way to write an ampersand (or another fix to my superkaramba problem)? fibbi Linux - Software 1 04-23-2004 02:51 PM

LinuxQuestions.org > Forums > LinuxQuestions.org > LQ Suggestions & Feedback

All times are GMT -5. The time now is 12:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration