Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

HTML Formatter

Where can I find the HTML formatter used on Lussumo's Community? The one extension I have is "Raw HTML", but not simply HTML. Is that an extension or am I missing something? Thanks!

Comments

  • It should come with the basic Vanilla installation, like Markdown.
  • No, the one that comes with basic Vanilla is called "Raw HTML", and it shows as such under "Format comments as". In here it shows as HTML only. Are they the same thing, just text renamed?
  • Boy, I can't see well on Mondays. HTML Formatter as well as Raw HTML formatter are default extensions. I am blind, sorry.
  • I have a question about the html ouput of the formatter and didn't want to start a new thread :) When I'm in HTML mode, line breaks are still replaced by <br />. This is annoying. It's ok when you add a link but when you insert block elements you get additional spacing. Not to mention that the output code is invalid. For example you can get unnecessary <br />s in somewhere in the markup of a list. My question is: is there a way to switch to pure html mode (without any auto-formatting)
  • Change the line that looks like return str_replace( array("\r\n", "\r", "\n"), array("\n", "\n", '<br>'), preg_replace($Patterns, $Replacements, $String) ); To just return preg_replace($Patterns, $Replacements, $String); and it shouldn't change newlines.
  • Thanks. I would have maybe found this by myself but it's better to be sure.
  • I just made this change as well, thanks for the fix SirNot. Just wondering, shouldn't HTML style perform this way by default?
  • Well, yes and no. First and foremost, it relies on the fact that newlines are converted to line breaks to get rid of several XSS exploits. However, most people would probably find it annoying to have to type <br> every time they wanted a newline when the only html they needed rendered was a couple of emphasizes tags or something.
  • Can the line breaks be replaced by some other character in order to prevent cross site scripting issues ? I don't want exploits but line breaks are annoying in my case.
  • Well they were mainly just important for distrupting tags that went over one line in length, so I suppose you could just add in a character or something inside tags... I think I need to revise a few things in the formatter though, anyways, so I might add a definition in or something which allows people to specify if they want it to replace newlines or not.
  • I know what you mean. Javascript code on several lines, etc. I'm looking forward to this and other changes. Thanks for this useful extension.
  • Alright, I made some major updates to it, not only eliminating some holes in it but adding in the ability to make sure there are no stray opening/closing tags (ie. cleaning the markup, pun not intended). In addition, there are numerous settings which you can easily tweak in the file to govern how you want it to parse each comment. You'll have to bear with me if a part of it dosn't work completely as planned, though, I'm not the best at testing... http://lussumo.com/addons/?PostBackAction=AddOn&AddOnID=33
  • dimdim
    edited July 2006
    Returning to my previous question: couldn't be line breaks replaced by, say, &nbsp; ? Would that play the same role as <br /> ?
  • edited July 2006
    & n b s p; makes sure the line doesn't break, <br /> makes the line break, they are opposites.
  • I know. I meant in terms of security.
  • ToivoToivo New
    edited August 2006
    a minor thing but some websites have commas in the url edit: naah. so it is fixed now? http://www.nokia.com/nseries/index.html?lang=en&country=US#product,n93
  • How Do i make the default post type to be html, instead of text.
  • Check the Dojo extension or this post http://lussumo.com/community/discussion/2696/disabling-plain-text/#Item_6
  • edited December 2006
    Wouldn't it be cool to allow the GMail audio/video player in the HTML formatter? I would certainly use it! The feature is described here

    In the future it would be very cool to integrate this with the Attachments add-on, essentially allowing anyone to publish audio and video directly into discussions.
This discussion has been closed.