Rosetta Code:Village Pump/Pre to Lang Tag Fixer: Difference between revisions

From Rosetta Code
Content added Content deleted
No edit summary
(Not all pres are code.)
Line 62: Line 62:


--[[User:Guga360|Guga360]] 23:27, 20 February 2009 (UTC)
--[[User:Guga360|Guga360]] 23:27, 20 February 2009 (UTC)
: I thought about it, but not all instances of <nowiki><pre></nowiki> are code snippets. Several are just output. There's also a bunch of examples out there that use leading whitespace for the same effect. I think these will need to be done by hand. --[[User:Short Circuit|Short Circuit]] 23:44, 20 February 2009 (UTC)

Revision as of 23:44, 20 February 2009

I'm thinking, if we did Code Tag Fixer, why not make a Pre Tag Fixer? I already did a bot, but i need a hash/dict, like this:

Python= python

C Sharp = csharp

Java = java5

Common Lisp = lisp


I need this, because just lowercasing and removing spaces isn't very secure.


Input: <lang>

Ada

testeblabla

lalal

lululu

Python

aiaiai

C#

aiai
uiui

</lang>

Output:

=={{header|Ada}}==
testeblabla

<lang ada>
lalal
</lang>

lululu

=={{header|Python}}==
<lang python>
aiaiai
</lang>

=={{header|C sharp}}==
<lang csharp>
aiai
uiui
</lang>

--Guga360 23:27, 20 February 2009 (UTC)

I thought about it, but not all instances of <pre> are code snippets. Several are just output. There's also a bunch of examples out there that use leading whitespace for the same effect. I think these will need to be done by hand. --Short Circuit 23:44, 20 February 2009 (UTC)