44 lines
6.0 KiB
HTML
44 lines
6.0 KiB
HTML
|
|
|
|
<div id="sina_keyword_ad_area2" class="articalContent ">
|
|
<div>private string HtmlToUBB(string _Html)</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr>{</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr>_Html = Regex.Replace(_Html,"<br[^>]*>","\n");</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr>_Html = Regex.Replace(_Html,@"<p[^>\/]*\/>","\n");</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr>_Html = Regex.Replace(_Html,"\\son[\\w]{3,16}\\s?=\\s*([\'\"]).+?\\1", "");</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr>_Html = Regex.Replace(_Html,"<hr[^>]*>","[hr]");</div>
|
|
<div><br>
|
|
</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr>_Html = Regex.Replace(_Html,"<(\\/)?blockquote([^>]*)>","[$1blockquote]");</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr>_Html = Regex.Replace(_Html,"<img[^>]*smile=\"(\\d+)\"[^>]*>","'[s:$1]");</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr>_Html = Regex.Replace(_Html,"<img[^>]*src=[\'\"\\s]*([^\\s\'\"]+)[^>]*>","");</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr>_Html = Regex.Replace(_Html,"<a[^>]*href=[\'\"\\s]*([^\\s\'\"]*)[^>]*>(.+?)<\\/a>","[url=$1]$2[/url]");</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr>_Html = Regex.Replace(_Html,"<b>(.+?)</b>",@"\[b\]$1\[/b\]");</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr>_Html = Regex.Replace(_Html,"<[^>]*?>", "");</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr>_Html = Regex.Replace(_Html,"&amp;", "&");</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr>_Html = Regex.Replace(_Html,"&nbsp;", " ");</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr>_Html = Regex.Replace(_Html,"&lt;", "<");</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr>_Html = Regex.Replace(_Html,"&gt;", ">");</div>
|
|
<div><br>
|
|
</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr>return _Html;</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr>}</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr>public string UBBToHtml(stringcontent) <wbr>//ubb转html</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr>{</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr>content = Regex.Replace(content, @"\r\n","<br/>");</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr>content = Regex.Replace(content, " ","&nbsp;");</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr>content = Regex.Replace(content,@"\[b\](.+?)\[/b\]","<b>$1</b>");</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr>content = Regex.Replace(content,@"\[i\](.+?)\[/i\]","<i>$1</i>");</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr>content = Regex.Replace(content,@"\[u\](.+?)\[/u\]","<u>$1</u>");</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr>content = Regex.Replace(content,@"\[p\](.+?)\[/p\]", "<pclass='load'>$1</p>");</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr>content = Regex.Replace(content,@"\[align=left\](.+?)\[/align\]","<align='left'>$1</align>");</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr>content = Regex.Replace(content,@"\[align=center\](.+?)\[/align\]","<align='center'>$1</align>");</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr>content = Regex.Replace(content,@"\[align=right\](.+?)\[/align\]","<align='right'>$1</align>");</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr>content = Regex.Replace(content,@"\[url=(?<url>.+?)]\[/url]","<a href='${url}'target=_blank>${url}</a>");</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr>content = Regex.Replace(content,@"\[url=(?<url>.+?)](?<name>.+?)\[/url]","<a href='${url}'target=_blank>${name}</a>");</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr>content = Regex.Replace(content,@"\[quote](?<text>.+?)\[/quote]","<divclass=quote>${text}</div>");</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr>content = Regex.Replace(content,@"\[img](?<img>.+?)\[/img]","<img src='${img}' alt=''/>");</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr>return content;</div>
|
|
<div> <wbr> <wbr> <wbr> <wbr> <wbr>}</div>
|
|
</div>
|
|
|