Jump to content

Request for information on BBcode, but not what you are expecting

straight_stewie

So this has happened to me a couple of times: You have an internal document or otherwise have written a post in a local WSIWYG editor like Word, and you decide that you want to make a forum post about it that could use large portions of your already built document, however, copy pasta isn't always so delicious.

I've played around a very tiny amount in the "test" section and have noticed that atleast some basic BBcode functionality still works, even though the mood around here is "BBcode is evil", probably because the forum isn't based on BBcode anymore. For some tasks, however, I think that using it is still beneficial (especially since it atleast partially still works).

I've looked around for applications that claim that they can convert popular document files into BBcode, but then they don't hardly work at all. They lose nested lists, text color, text size, the type of list, and the text style (bold, italic, strikethrough). The problem is that these are the only parts of a document that you care to have transferred to a forum.

To remedy these issues, I would like to build a program to parse Open Office XML (.docx file format) into BBcode that actually works. To be clear, this is not a request for any forum changes, rather for forum information. My questions are: Does the forum support all standard BBcode tags? Are there proprietary tags? If there are proprietary tags, is there a document that contains them and their description?
 

ENCRYPTION IS NOT A CRIME

Link to comment
Share on other sites

Link to post
Share on other sites

My understanding is that very basic tags are supported just to keep compatibility to old version alive. But otherwise IPS has denied any requests to continue full support.

 

In all, you should always paste without formatting from external sources and redo all formatting in forum editor. Posts use html format. And even copypaste from forum post (not editor) to another will break things like default text color.

^^^^ That's my post ^^^^
<-- This is me --- That's your scrollbar -->
vvvv Who's there? vvvv

Link to comment
Share on other sites

Link to post
Share on other sites

Supported tags, according to the forum source code:

  • acronym
  • background
  • b
  • code (as well as codebox, html, php, sql and xml, which are all exact synonyms)
  • color
  • font
  • hr
  • img
  • indent
  • i
  • left
  • center
  • right
  • email
  • member
  • url
  • list
  • quote
  • size
  • spoiler
  • s (or strike)
  • sub
  • sup
  • u

Many of them require arguments (such as url requiring the URL).

HTTP/2 203

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, colonel_mortis said:

Supported tags, according to the forum source code:

That's great. Thank you.

ENCRYPTION IS NOT A CRIME

Link to comment
Share on other sites

Link to post
Share on other sites

11 minutes ago, iamdarkyoshi said:

I still have to use BBCode for formatting because the buttons I need above are always missing...

 

Screenshot_20170423-112043.thumb.png.31e02ee78622a459b1723a8095bb36c0.png

Which buttons are those? The available space on the toolbar is limited (because it can only be set for specific preset editor widths), but if there is demand for a different button, it can be changed.

HTTP/2 203

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, colonel_mortis said:

Which buttons are those? The available space on the toolbar is limited (because it can only be set for specific preset editor widths), but if there is demand for a different button, it can be changed.

I use size, font, strikethrough, color, and a couple others. Definitely color though. Ao I can fix formatting... Can we have a dropdown for more options, like how spoilers can be collapsed? I'd honestly much rather have multiple lines than one line missing buttons

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, iamdarkyoshi said:

I use size, font, strikethrough, color, and a couple others. Definitely color though. Ao I can fix formatting... Can we have a dropdown for more options, like how spoilers can be collapsed? I'd honestly much rather have multiple lines than one line missing buttons

I realise that it's partly because the buttons aren't there, but I just went through your latest 250 posts, and the only formatting that I saw was bold. Yes, some formatting can be useful occasionally, but not frequently enough to justify removing other buttons IMO.

The editor doesn't break the buttons onto a new line very gracefully, though that is an option.

A dropdown would be ideal, but unfortunately it's not supported by the editor in a useful way.

HTTP/2 203

Link to comment
Share on other sites

Link to post
Share on other sites

My first idea would be to export the document to HTML , then run it through htmlpurifier which can clean up the code, close missing tags etc .. and then it should be straight forward to convert html tags to bb code .

 

Link to comment
Share on other sites

Link to post
Share on other sites

7 minutes ago, mariushm said:

My first idea would be to export the document to HTML , then run it through htmlpurifier which can clean up the code, close missing tags etc .. and then it should be straight forward to convert html tags to bb code .

Modern documents (text, spreadsheet, and slide) use Office Open XML anyway. It would just be extra steps (and more lossy) to convert to another Markup Language, and then to yet another (when you convert a Word document to HTML, it carries along ALOT of extra information, and loses some semantics) I was already toying with the idea of writing an OOXML parser that can read another XML document specifying "cares", "ignores" and "actions" to be able to convert and modify these documents. This just gives me more drive to do it, especially since I now have a thread that will be updated regularly and relies on my own internal documents anyway.

Truth be told though, this is a large undertaking (especially for one person, and not an extremely experienced one either) and it will be a few months before the project is completed to a point where I will feel comfortable sharing it. I do plan to submit it for inclusion in the "Forum Apps" thread though.

ENCRYPTION IS NOT A CRIME

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, straight_stewie said:

Modern documents (text, spreadsheet, and slide) use Office Open XML anyway. It would just be extra steps (and more lossy) to convert to another Markup Language, and then to yet another (when you do this in Word, it carries along ALOT of extra information, and loses some semantics) I was already toying with the idea of writing an OOXML parser that can read another XML document specifying "cares", "ignores" and "actions" to be able to convert and modify these documents. This just gives me more drive to do it, especially since I now have a thread that will be updated regularly and relies on my own internal documents anyway.

Truth be told though, this is a large undertaking (especially for one person, and not an extremely experienced one either) and it will be a few months before the project is completed to a point where I will feel comfortable sharing it. I do plan to submit it for inclusion in the "Forum Apps" thread though.

If you do write a parser, I would suggest parsing it into HTML instead, then copying the HTML as rich text so you can paste it directly into the editor.

HTTP/2 203

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, colonel_mortis said:

I realise that it's partly because the buttons aren't there, but I just went through your latest 250 posts, and the only formatting that I saw was bold. Yes, some formatting can be useful occasionally, but not frequently enough to justify removing other buttons IMO.

The editor doesn't break the buttons onto a new line very gracefully, though that is an option.

A dropdown would be ideal, but unfortunately it's not supported by the editor in a useful way.

Quite a bit of my formatting is done with keyboard shortcuts like ctrl B on mobile. My main issue is a button for color. I can't remove formatting without turning the quote into regular text. Look in my signature, its formatted and I can't remove the color on it.

Link to comment
Share on other sites

Link to post
Share on other sites

I too also sometimes have to revert to BBCode for strikethrough in some instances, because often I noticed even on desktop, the editor in status updates doesnt always show the button for strike through.

a Moo Floof connoisseur and curator.

:x@handymanshandle x @pinksnowbirdie || Jake x Brendan :x
Youtube Audio Normalization
 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

When it says "BBCode", does it refer to only BBCode? Or all markup(markdown?)? Does this forum not have access to its own markup(markdown?) language? Does the forum have to use a form of encryption of markup(markdown?) and therefore it is totally impossible to give users access to markup(markdown?) coding?

 

Seems extremely odd. I have no doubt using the "BBCode" is impossible, because BBCode is not used. But I don't believe no code is used.

Link to comment
Share on other sites

Link to post
Share on other sites

9 hours ago, xnamkcor said:

When it says "BBCode", does it refer to only BBCode? Or all markup(markdown?)? Does this forum not have access to its own markup(markdown?) language? Does the forum have to use a form of encryption of markup(markdown?) and therefore it is totally impossible to give users access to markup(markdown?) coding?

 

Seems extremely odd. I have no doubt using the "BBCode" is impossible, because BBCode is not used. But I don't believe no code is used.

The forum supports entering BBCode, the standardish markup language that uses [square brackets]. The rich text editor produces (sanitised) HTML, and any BBCode you have entered is also parsed into HTML for storage and display. There is no way to convert the produced HTML back into BBCode.

Markdown, the markup language that is used on sites like reddit and stack exchange, with _ and * for styling, is not supported at all.

There are no plans to expose an HTML editor, because the HTML is heavily sanitised before being displayed, so it would mess what you entered.

HTTP/2 203

Link to comment
Share on other sites

Link to post
Share on other sites

49 minutes ago, colonel_mortis said:

The forum supports entering BBCode, the standardish markup language that uses [square brackets]. The rich text editor produces (sanitised) HTML, and any BBCode you have entered is also parsed into HTML for storage and display. There is no way to convert the produced HTML back into BBCode.

Markdown, the markup language that is used on sites like reddit and stack exchange, with _ and * for styling, is not supported at all.

There are no plans to expose an HTML editor, because the HTML is heavily sanitised before being displayed, so it would mess what you entered.

So, the final product of the post is not what was actually indicated in the BB Code used when making the post, if you use BBCode when writing the post?

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, xnamkcor said:

So, the final product of the post is not what was actually indicated in the BB Code used when making the post, if you use BBCode when writing the post?

If you write it in BBCode, it will be converted to the appropriate HTML for storage/etc, so the output will match what you would expect from the BBCode that you entered, but it is not actually stored as BBCode.

HTTP/2 203

Link to comment
Share on other sites

Link to post
Share on other sites

  • 2 weeks later...
On 4/27/2017 at 4:24 AM, colonel_mortis said:

There are no plans to expose an HTML editor, because the HTML is heavily sanitised before being displayed, so it would mess what you entered.

That's terrific. It's good to see, and be a part of, sites that take security seriously.

ENCRYPTION IS NOT A CRIME

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×