## Automatic [code] tags

Discussion related to the Website functionality, user accounts and graphic design.

Moderator: coordinators

### Automatic [code] tags

I'm kinda just thinking aloud here, but is it possible (I should imagine it is, but I'm not that good with PHP) to have a forum script that will recognise common error logs and automatically wrap them in [ code] tags? They can be rather long, and putting them in their own box makes the post a lot more readable.
Pilchard123

Posts: 407
Joined: Sun Oct 30, 2011 8:05 am

### Re: Automatic [code] tags

Can't you just type '
Code: Select all
' and '
'? It is probably possible, but it really isn't difficult to add tags manually. You can even highlight your code, then click the 'code' button above the post box and it will automatically wrap the highlighted text in code, or you can click code first, and then paste your text between the tags.
Studio XPS 9100 | 2.8 Ghz Intel 930 | 12 GB RAM | Radeon 7970 3GB

A-man

Posts: 691
Joined: Sat Apr 24, 2010 4:24 pm

### Re: Automatic [code] tags

I know it isn't hard to add tags manually, but I just thought that when people that leave huge WoTs in error posts it's hard to read. Asking that they tag it seems a little picky (for want of a better word), particularly if you don't have anything else relevant to say. Like I said, I was just really thinking aloud and seeing what other people thought.
Pilchard123

Posts: 407
Joined: Sun Oct 30, 2011 8:05 am

### Re: Automatic [code] tags

You are right about the "picky" thing, I experienced that, too.
The automatic recognition is also a good idea, but I see some difficulties there. I know nearly nothing about the forums software, but such a recognition would require a parse of every comment made - after hard-detectable signs of "log-message style text"...
And maybe sometimes normal text would be detected by mistake, like it is already with the 8 - ) thing.

B.Y.O.B.

Posts: 1910
Joined: Wed Nov 10, 2010 4:10 pm
Location: Germany