Joel Posted April 27, 2006 Share Posted April 27, 2006 I see many people using the code tags when posting the HTML / XHTML source. Did you know that there is a bbcode for HTML? If you use [html][/html] tags instead of the code tags, you can post HTML code that displays in a more helpful manner. Example: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>W3C HTML Home Page</title> <meta name="keywords" content="HTML, HTML 4, HTML 4.01, HTML 4.0, XHTML, XHTML 1.0, XHTML 1.1, XHTML Basic, Modularization of XHTML, XML Events, XHTML-Print, XHTML 2.0, HTML Activity, HTML Working Group" /> <meta name="description" content="This is W3C's home page for the HTML Activity. Here you will find pointers to our specifications for HTML/XHTML, guidelines on how to use HTML/XHTML to the best effect, and pointers to related work at W3C." /> <link rel="stylesheet" type="text/css" href="markup.css" /> <link rel="stylesheet" type="text/css" href="../StyleSheets/public.css" /> <link rel="stylesheet" type="text/css" media="handheld" href="style/handheld.css" /> <link rel="stylesheet" type="text/css" media="print" href="style/print.css" /> <link rel="bookmark" href="#top" title="Page top" /> <link rel="start" href="../" title="W3C Home Page" /> <link rel="contents" href="#navbar" title="Navigation" /> <link rel="bookmark" href="#news" title="News" /> <link rel="bookmark" href="#recommendations" title="RECs" /> <link rel="bookmark" href="#drafts" title="Drafts" /> <link rel="appendix" href="Activity" title="Activity Statement" /> <link rel="appendix" href="xhtml-roadmap/" title="Roadmap" /> <link rel="appendix" href="2004/xhtml-faq" title="FAQ" /> <link rel="appendix" href="modularization" title="M12N Overview" /> <link rel="appendix" href="historical" title="Historical" /> <link rel="appendix" href="news" title="News Archive" /> <link rel="appendix" href="Articles" title="Articles" /> <link rel="appendix" href="translations" title="Translations" /> <link rel="help" href="../Help/siteindex" title="Site Index" /> <link rel="glossary" href="../2001/12/Glossary" title="Glossary" /> <link rel="copyright" href="#copyright" title="Copyright" /> <link rel="alternate" type="text/html" title="HTML version" href=",html" /> <link rel="alternate" type="application/xhtml+xml" title="XHTML version" href=",xhtml" /> </head> <body> <div class="footer"> <p id="copyright" class="copyright"><a rel="Copyright" href="/Consortium/Legal/ipr-notice#Copyright">Copyright</a> ?1995-2006 <a href="/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>?</sup> (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="http://www.ercim.org/"><acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>, <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a href="/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>, <a rel="Copyright" href="/Consortium/Legal/copyright-documents">document use</a> and <a rel="Copyright" href="/Consortium/Legal/copyright-software">software licensing</a> rules apply. Your interactions with this site are in accordance with our <a href="/Consortium/Legal/privacy-statement#Public">public</a> and <a href="/Consortium/Legal/privacy-statement#Members">Member</a> privacy statements.</p> <p>This page was last modified on: $Date: 2006/02/06 15:52:10 $</p> </div> </body> </html> Link to comment Share on other sites More sharing options...
0 samg Posted April 27, 2006 Share Posted April 27, 2006 <div class="MenuBoxes"> <div class="Gradient">Recent posts </div> <div class="ItemContent"> <?php require_once "php/recenttopics.php"; ?> </div> </div> Thats cool! Pitty it doesnt work on PHP ! :( Link to comment Share on other sites More sharing options...
0 John Veteran Posted April 27, 2006 Veteran Share Posted April 27, 2006 Thats cool!Pitty it doesnt work on PHP ! :( However the code tag does work for PHP I think. Link to comment Share on other sites More sharing options...
0 samg Posted April 27, 2006 Share Posted April 27, 2006 However the code tag does work for PHP I think. <?php require_once "php/recenttopics.php"; ?> Nope. :( Link to comment Share on other sites More sharing options...
0 The_Decryptor Veteran Posted April 27, 2006 Veteran Share Posted April 27, 2006 <p><strong>Cool!</strong></p> Now all we need is one for CSS, PHP, etc. :p echo "echo"; < was worth a shot. Link to comment Share on other sites More sharing options...
0 +M2Ys4U Subscriber¹ Posted April 27, 2006 Subscriber¹ Share Posted April 27, 2006 <?Php require(PHP_BBCODE): ?> Link to comment Share on other sites More sharing options...
0 nemo Posted April 27, 2006 Share Posted April 27, 2006 http://mods.invisionize.com/db/index.php/f/4155 ^ That's for IPB 2.0.x... I don't think it's been upgraded to 2.1 yet... but that's what we have the coderators for :) Link to comment Share on other sites More sharing options...
0 Joel Posted April 27, 2006 Author Share Posted April 27, 2006 http://mods.invisionize.com/db/index.php/f/4155 ^ That's for IPB 2.0.x... I don't think it's been upgraded to 2.1 yet... but that's what we have the coderators for :) http://mods.invisionize.com/db/index.php/f/5955 Link to comment Share on other sites More sharing options...
0 samg Posted April 27, 2006 Share Posted April 27, 2006 http://mods.invisionize.com/db/index.php/f/5955 So why isnt it installed already ?! Link to comment Share on other sites More sharing options...
0 lunamonkey Posted April 27, 2006 Share Posted April 27, 2006 Joel, could the html one keep the whitespace like code does? Maybe people use code so that it preserves formatting, unlike the HTML <a href="#">fourspaces [ ]</a> <a href="#">fourtabs[ ]</a> <a href="#">fourspaces [ ]</a> <a href="#">fourtabs[ ]</a> Link to comment Share on other sites More sharing options...
0 The_Decryptor Veteran Posted April 27, 2006 Veteran Share Posted April 27, 2006 i would like to see this added in (so would generate CSS highlighting) http://qbnz.com/highlighter/ that library supports plugins it's self, so it's quite easy to add new syntax support. Link to comment Share on other sites More sharing options...
0 nemo Posted April 28, 2006 Share Posted April 28, 2006 http://mods.invisionize.com/db/index.php/f/5955 there ya go... it's a quick implementation :) Link to comment Share on other sites More sharing options...
0 The_Decryptor Veteran Posted April 28, 2006 Veteran Share Posted April 28, 2006 Joel, could the html one keep the whitespace like code does? Maybe people use code so that it preserves formatting, unlike the HTML <a href="#">fourspaces [ ]</a> <a href="#">fourtabs[ ]</a> <a href="#">fourspaces [ ]</a> <a href="#">fourtabs[ ]</a> Because HTML is handled like that by browsers (only way to get multiple spaces is to use ) Link to comment Share on other sites More sharing options...
0 jokeripa Posted May 11, 2006 Share Posted May 11, 2006 [p][b][test[/b] [/p] Link to comment Share on other sites More sharing options...
0 Menge Posted May 11, 2006 Share Posted May 11, 2006 Because HTML is handled like that by browsers (only way to get multiple spaces is to use ) but we're posting the source... that's before it gets to the browser :p so it should keep the spacing :) Link to comment Share on other sites More sharing options...
0 The_Decryptor Veteran Posted May 11, 2006 Veteran Share Posted May 11, 2006 but we're posting the source... that's before it gets to the browser :p so it should keep the spacing :) Brings in inconsistencies that people don't need. If your just beginning, and somebody shows you something like this <p>This is a test</p> They wont have any idea why the code shows as "This is a test" in their web browser. And the reason keeps extra spaces is because some languages need that spacing, HTML does not. Link to comment Share on other sites More sharing options...
0 Menge Posted May 11, 2006 Share Posted May 11, 2006 Brings in inconsistencies that people don't need. If your just beginning, and somebody shows you something like this <p>This is a test</p> They wont have any idea why the code shows as "This is a test" in their web browser. And the reason keeps extra spaces is because some languages need that spacing, HTML does not. HTML does have identation too... not to mention that the original source code is what really helps people... showing them an edited version might not really help them. if you're showing the source, show it how it is... only "beautify" it if you're showing the content itself... that's my opinion :) Link to comment Share on other sites More sharing options...
0 The_Decryptor Veteran Posted May 11, 2006 Veteran Share Posted May 11, 2006 HTML does have identation too... not to mention that the original source code is what really helps people... showing them an edited version might not really help them. if you're showing the source, show it how it is... only "beautify" it if you're showing the content itself... that's my opinion :) yes, HTML does have indentation, which the browser strips out when it parses it (Safari had a small bug in XHTML mode a while ago that didn't strip it out, every tab was converted to a blank character) and it's not a needed part of the language. And the "renderer" is showing the HTML correctly, padding it with unneeded spaces is the wrong way to go IMO There is one problem with it though, it ignores <pre> tags. Link to comment Share on other sites More sharing options...
0 Menge Posted May 11, 2006 Share Posted May 11, 2006 yes, HTML does have indentation, which the browser strips out when it parses it (Safari had a small bug in XHTML mode a while ago that didn't strip it out, every tab was converted to a blank character) and it's not a needed part of the language. And the "renderer" is showing the HTML correctly, padding it with unneeded spaces is the wrong way to go IMO There is one problem with it though, it ignores <pre> tags. you didn't get my point :p but nevermind. i'll just let go of it :) good we have a tag that shows highlighted HTML code :) Link to comment Share on other sites More sharing options...
0 Joel Posted May 12, 2006 Author Share Posted May 12, 2006 [p][b][test[/b] [/p] What's that supposed to be? That's bbcode, not HTML. Did you mean <p><b>[test</b> </p> ? Link to comment Share on other sites More sharing options...
0 Kudos Veteran Posted May 27, 2006 Veteran Share Posted May 27, 2006 Because HTML is handled like that by browsers (only way to get multiple spaces is to use ) Surely that point is moot when the browser also doesn't output the tags themselves, yet does. Another vote in favour of <pre> here Link to comment Share on other sites More sharing options...
0 TheBrotherhood313 Posted August 23, 2006 Share Posted August 23, 2006 Yep I knew this was an IPB feature. Anyone could easily add a bbcode button like the Code one but its just not default on the bar. Also, there is a mod for the PHP tag. Basicly the same as HTML but it highlights the code according to PHP. Nice features none the less. Link to comment Share on other sites More sharing options...
0 neo2.0 Posted September 21, 2006 Share Posted September 21, 2006 What the #$%^& is HTML bbcode? Are you guys hackers?? Link to comment Share on other sites More sharing options...
0 xxdesmus Posted September 21, 2006 Share Posted September 21, 2006 CSS handling would be nice as well, but the (X)HTML is nice, thanks for the tip ;) Link to comment Share on other sites More sharing options...
0 APH-Alex Posted December 30, 2006 Share Posted December 30, 2006 <i>WTF?!</i> Link to comment Share on other sites More sharing options...
0 Pox Posted January 12, 2007 Share Posted January 12, 2007 Joel, could the html one keep the whitespace like code does?Maybe people use code so that it preserves formatting, unlike the HTML <a href="#">fourspaces [ ]</a> <a href="#">fourtabs[ ]</a> <a href="#">fourspaces [ ]</a> <a href="#">fourtabs[ ]</a> ...except whitespace is meaningless over 1 space in HTML anyway. 0_o Link to comment Share on other sites More sharing options...
Question
Joel
I see many people using the code tags when posting the HTML / XHTML source. Did you know that there is a bbcode for HTML?
If you use
tags instead of the code tags, you can post HTML code that displays in a more helpful manner. Example:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>W3C HTML Home Page</title> <meta name="keywords" content="HTML, HTML 4, HTML 4.01, HTML 4.0, XHTML, XHTML 1.0, XHTML 1.1, XHTML Basic, Modularization of XHTML, XML Events, XHTML-Print, XHTML 2.0, HTML Activity, HTML Working Group" /> <meta name="description" content="This is W3C's home page for the HTML Activity. Here you will find pointers to our specifications for HTML/XHTML, guidelines on how to use HTML/XHTML to the best effect, and pointers to related work at W3C." /> <link rel="stylesheet" type="text/css" href="markup.css" /> <link rel="stylesheet" type="text/css" href="../StyleSheets/public.css" /> <link rel="stylesheet" type="text/css" media="handheld" href="style/handheld.css" /> <link rel="stylesheet" type="text/css" media="print" href="style/print.css" /> <link rel="bookmark" href="#top" title="Page top" /> <link rel="start" href="../" title="W3C Home Page" /> <link rel="contents" href="#navbar" title="Navigation" /> <link rel="bookmark" href="#news" title="News" /> <link rel="bookmark" href="#recommendations" title="RECs" /> <link rel="bookmark" href="#drafts" title="Drafts" /> <link rel="appendix" href="Activity" title="Activity Statement" /> <link rel="appendix" href="xhtml-roadmap/" title="Roadmap" /> <link rel="appendix" href="2004/xhtml-faq" title="FAQ" /> <link rel="appendix" href="modularization" title="M12N Overview" /> <link rel="appendix" href="historical" title="Historical" /> <link rel="appendix" href="news" title="News Archive" /> <link rel="appendix" href="Articles" title="Articles" /> <link rel="appendix" href="translations" title="Translations" /> <link rel="help" href="../Help/siteindex" title="Site Index" /> <link rel="glossary" href="../2001/12/Glossary" title="Glossary" /> <link rel="copyright" href="#copyright" title="Copyright" /> <link rel="alternate" type="text/html" title="HTML version" href=",html" /> <link rel="alternate" type="application/xhtml+xml" title="XHTML version" href=",xhtml" /> </head> <body> <div class="footer"> <p id="copyright" class="copyright"><a rel="Copyright" href="/Consortium/Legal/ipr-notice#Copyright">Copyright</a> ?1995-2006 <a href="/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>?</sup> (<a href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of Technology">MIT</abbr></a>, <a href="http://www.ercim.org/"><acronym title="European Research Consortium for Informatics and Mathematics">ERCIM</acronym></a>, <a href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a href="/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>, <a href="/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>, <a rel="Copyright" href="/Consortium/Legal/copyright-documents">document use</a> and <a rel="Copyright" href="/Consortium/Legal/copyright-software">software licensing</a> rules apply. Your interactions with this site are in accordance with our <a href="/Consortium/Legal/privacy-statement#Public">public</a> and <a href="/Consortium/Legal/privacy-statement#Members">Member</a> privacy statements.</p> <p>This page was last modified on: $Date: 2006/02/06 15:52:10 $</p> </div> </body> </html>Link to comment
Share on other sites
29 answers to this question
Recommended Posts