![]() |
![]() |
#1 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,265
|
BBCode formatting for code
I'm wondering if it's possible to add/enable one of those convenient BBCode extensions that allow you to insert highlighted and formatted code in the middle of a line of text, without all the line breaks that [CODE] gives.
Sort of like this: http://stackoverflow.com/questions/2...g-point-values |
![]() |
![]() |
#2 |
Global Moderator
![]() Join Date: Sep 2008
Location: Nürburgring Nordschleife/Geordie Land
Age: 55
Posts: 4,096
|
yup, all RCK needs to do is to add a new user defined BBCode like the following
New tag = [hl] (short for highlight) <span style="background-color: yellow;">{param}</span> (yellow being the highlight colour, this can be changed of course) And that's it ![]() And add a custom button image to use ![]() |
![]() |
![]() |
#4 | |
Administrator
![]() Join Date: Feb 2001
Location: Paris / France
Age: 44
Posts: 3,007
|
Quote:
![]() Leffmann: post one example of what you would like ![]() |
|
![]() |
![]() |
#5 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,265
|
Syntax highlighting is not necessary, just a fixed width font and a change of background color, so you can write a small bit of legible code in the middle of a sentence. Like [CODE], but inlined.
edit: the one on the right that reads "malloc" looks just right I think, same font and colors as [CODE] here on EAB. Last edited by Leffmann; 09 December 2013 at 20:01. |
![]() |
![]() |
#6 |
Global Moderator
![]() Join Date: Sep 2008
Location: Nürburgring Nordschleife/Geordie Land
Age: 55
Posts: 4,096
|
<font face="courier new"><span style="background-color:#e7e8f5; color:black">{param}</span></font>
That above code will use the 'Courier New' fixed width font (the same font used in EAB's [CODE] tag), give it the background colour the same as your 3rd image, and keep the font colour black. ![]() Is that what you're asking Leffmann? And just to clarify, what you're wanting isn't to be included within [CODE] tags as RCK mentioned earlier? Last edited by DH; 09 December 2013 at 22:09. Reason: Updated example image |
![]() |
![]() |
#7 |
Computer Nerd
![]() Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 46
Posts: 3,267
|
Cool
![]() How about Lucida Console: move.l d0,(a0)+ Seems nice. |
![]() |
![]() |
#8 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,265
|
Yes exactly as you've done there, DH, for use in the middle of a regular sentence, outside of [CODE]. Important is also that it must stop parsing just like [CODE], so it doesn't consolidate spaces and replace text with smilie-icons.
I like the font and colors that [CODE] uses, it just makes all the code snippets look more consistent. |
![]() |
![]() |
#9 |
Global Moderator
![]() Join Date: Sep 2008
Location: Nürburgring Nordschleife/Geordie Land
Age: 55
Posts: 4,096
|
I have a feeling this is going to be rather more difficult than I first thought.
What you're wanting is a bbcode that will [noparse] the given text that is to be highlighted (We'll call it that for now), but I already know it can't do that without the [noparse] destroying the highlighting bbcode at the same time, because the very text you're wanting to highlight is the very same text you are wanting to strip with [noparse] The three tags that could be used are <pre> <xmp> <textarea>, but unfortunately, none of them work and none of them keep the highlight, despite the [noparse] tags being place inside the highlight code. I'm not an html expert, so if anyone else knows of a way around, feel free to jump in ![]() For me it's a kinda catch 22 situation, unless RCK can come up with some kind of script that will perform the noparsing but keep the highlight, then I have really no idea. |
![]() |
![]() |
#10 |
Rumpig
![]() Join Date: Aug 2006
Location: The bottom of the bottle
Age: 91
Posts: 237
|
VB custom bbcode construction includes a 'Disable Smilies Within This BB Code' checkbox.
I just did a test using the html you posted above DH and here is the result: ![]() |
![]() |
![]() |
#11 |
Global Moderator
![]() Join Date: Sep 2008
Location: Nürburgring Nordschleife/Geordie Land
Age: 55
Posts: 4,096
|
Haps, does that still consolidate spaces?
EDIT: nm, I have just checked and no it doesn't unfortunately ![]() Last edited by DH; 10 December 2013 at 16:26. |
![]() |
![]() |
#12 |
Rumpig
![]() Join Date: Aug 2006
Location: The bottom of the bottle
Age: 91
Posts: 237
|
Not an addon. 'VB custom bbcode construction' was obviously a poor choice of words (sounded good to drunken me at the time), I was just using the 'Add New BBCode' option.
My testing was done on VB4.2.2, and whatever I put between those custom tags came out exactly as I wrote it, could be it is not the same with this version. ![]() |
![]() |
![]() |
#13 |
Global Moderator
![]() Join Date: Sep 2008
Location: Nürburgring Nordschleife/Geordie Land
Age: 55
Posts: 4,096
|
I have sorted it
Do as you suggested and Disable smilies within the bbcode and use this code in replacement \o/ <pre style="display: inline; background-color:#e7e8f5; color:black">{param}</pre> EDIT: Now it's up to RCK to decide if he'll add it Example below:- ![]() EDIT2: Excuse the colours I used, as it's been done on our vBulletin site using our default colour scheme ![]() EDIT3: @haps, my testing was done in vB4.2.1 and I wouldn't expect there to be any difference between vB versions as it's using standard html code ![]() ![]() ![]() ![]() Last edited by DH; 10 December 2013 at 22:19. |
![]() |
![]() |
#14 |
Administrator
![]() Join Date: Feb 2001
Location: Paris / France
Age: 44
Posts: 3,007
|
let's test "code2" in a
demo with [ WhiteSpace]sentence. versus "code" in Code:
demo with [ WhiteSpace] It seems OK ![]() Thanks to DH for all testing and compilation of html info ![]() |
![]() |
![]() |
#15 |
Global Moderator
![]() Join Date: Sep 2008
Location: Nürburgring Nordschleife/Geordie Land
Age: 55
Posts: 4,096
|
Thanks RCK
![]() All of this is continuing to help me learn a little more of html code, just glad to have helped, albeit in a very small way ![]() |
![]() |
![]() |
#16 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,265
|
Yep that's perfect! Thanks a lot, all of you.
|
![]() |
![]() |
#17 |
Global Moderator
![]() Join Date: Aug 2008
Location: Sidcup, England
Posts: 10,300
|
Yes, that's a useful feature for highlighting small code excerpts.
![]() ![]() ![]() ![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Formatting Of Code For XAMOS | fishyfish | support.Apps | 1 | 29 July 2013 18:15 |
Formatting a disc | chris_newton | support.WinUAE | 4 | 07 October 2009 22:02 |
help before formatting | fc.studio | support.Apps | 3 | 25 December 2007 00:21 |
Formatting my HD ? | blade002 | support.Apps | 5 | 21 September 2007 22:19 |
3D code and/or internet code for Blitz Basic 2.1 | EdzUp | Retrogaming General Discussion | 0 | 10 February 2002 11:40 |
|
|