asp.net - Automatically hyper-link URL's and Email's using C#, whilst leaving bespoke tags in place -


I have a site that enables users to post messages in a forum.

Currently, if the user types a web address or email address and posts it, it is considered similar to any other lesson.

There are tools that can supply the web and email address with a lot of link to the user (tag / markup through some absurd) - these are sometimes used but are not always In addition, an unconscious 'image' tag can also be used in the context of images hosted on the web.

My purpose is for both those who use these existing tools to create hyperlink addresses, but also to complete those who only type a web or email address , And then automatically convert it to a hyperlink address (as soon as they submit their posts).

I One or two regular expressions that change a plain string web or email address, however, I do not want to explicitly manipulate such a address which is already used for site spoing tagging. Being controlled through, and that's where I'm stuck - how any web or email address has already been caged through bespoke tagging - I do not want to leave them.

Here are examples of bespoke tagging for some changes that I need to leave alone: ​​

  [URL = www.msn.com] www.msn.com [ / URL] [URL = http: //www.msn.com] http: //www.msn .com [/ URL] [EMAIL = Bob @ S. Mith.com] bob@smith.com [/ EMAIL] [IMG ] Www.msn.com/images/test.jpg [/ img] [img] http://www.msn.com/images/test.jpg [/ img]  

the following Examples are automatically added to the web & amp; Email links respectively:

  www.msn.com http://www.msn.com bob@smith.com  

Ideally, converting 'The appropriate postspak tags will apply to the links, which are applicable in earlier examples as per the preliminary examples:

  & lt; A href = "..." etc.  

They become:

  [URL = http: // www .. etc]  

Unfortunately From, we have a lot of historical data stored in this bespoke tagging, so now, we want to keep our users, rather than implementing a completely new way to post.

Any help would be greatly appreciated.

Thank you.

I use this method. I no longer have access to the complete codebase, so it is not See how it fits with forum-code to prevent double-linking, but try it out and see that it works for you ...

  /// & Lt; Summary & gt; /// ANCHOR turns any textual URL reference into a text block in HTML elements. /// & lt; / Summary & gt; Activate public static string link intake (source) {source = "" + source + ""; // Brett is now easier to change anything more neutral. Source = reggaex Change (source, "
| br / & gt; |

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -