Posted 17 years ago by Max
Version: 4.0.40
Avatar
Hello,

how can i parse codetags like bbcode with the codehighlighter.

For example.

[csharp]public class Foo
{
}[/csharp]

[url=http://www.actiprosoftware.com/]actiprosoftware[/url]

If i use <code language="C#"> nothing is happen.

Best regards,
Max

Comments (10)

Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Sorry but I think you might be trying to use the product for something that it is not intended.

CodeHighlighter will allow you to syntax highlight code as is. It won't take a [url] BBCode tag and convert that to a clickable link. Rather, if you write a BBCode language, it would highlight the [url] and [/url] part of that above text in a certain color and the other text in black.


Actipro Software Support

Posted 17 years ago by Max
Avatar
Ok thanks.
And how can i use codetags like <code language="C#">?
Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
If you mean like what we do in our forums, we take each message, look for those code tag blocks and if they are found, programmtically run the CodeHighlighterEngine on the contained code with the specified language. Then we merge the results back in place of the code tag block.


Actipro Software Support

Posted 17 years ago by Max
Avatar
Thanks, i thought this is a "out of the box" behavior?
Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
It is, CodeHighlighter is an ASP.NET control and will render the code contents of the control when used in ASP code. However it seems like you are trying to use it in the middle of forum posts, and in that case you probably are not using server controls. Therefore you have to do things more manually in this particular scenario. Hope that explains it.


Actipro Software Support

Posted 17 years ago by Max
Avatar
Hmm, there only ServerControls.

I tried this.

<code language="C#">
public class Foo
...

The output ist the same as the input ( no formatting ). Is there a missing configuration?
Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Sorry but I'm not quite sure what you are trying. CodeHighlighter is an ASP.NET server control. If you need help on its usage, then please look at the sample pages that are included with the product download. The inline page shows how to use it.


Actipro Software Support

Posted 17 years ago by Pablo Viale
Avatar
Hello, I am trying to do exactly what you say. I am creating my own blog tool and I will be pasting code examples in vb.net, css, html, etc.

I have my posts saved in a data base. I need some way to tag the code portions, for example:

...regular text here, plain english....
...code here...
...more plain english....

It is just exactly what you do with this Forum Tool.

Can you send me an example or a portion of code that would help me on how to do that?

It would be very very apreciatted. Thanks a lot!!!
Posted 17 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Pablo,

I will reply to your other related post with info.


Actipro Software Support

Posted 17 years ago by lx2222182@yahoo.com
Avatar
Hey all,

I was trying to do exactly what you guys wanted to do for my own software (i have a forum board in there), I post my code in the following thread, hope it helps.

http://www.actiprosoftware.com/Support/Forums/ViewForumTopic.aspx?ForumTopicID=1957
The latest build of this product (v4.0.59) was released 13 years ago, which was after the last post in this thread.