Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Function NormalizeCode(ByVal code As String) As String
- If code = String.Empty Then
- Return String.Empty
- Else
- 'Replace font
- Dim step1 As String = code '.Replace("monospace", """Courier New""")
- 'Build a string of style
- Dim style As String = "</style>"
- 'Dim grid As String = "<div align=""center""><div style=""border-bottom: rgb(161,194,224) 1px solid; text-align: left; border-left: rgb(161,194,224) 1px solid; padding-bottom: 3px; margin: 0px; padding-left: 3px; width: 70%; padding-right: 3px; background: rgb(255,255,255); height: 300px; overflow: auto; border-top: rgb(161,194,224) 1px solid; border-right: rgb(161,194,224) 1px solid; padding-top: 3px; moz-background-clip: border; moz-background-origin: padding; moz-background-inline-policy: continuous"" dir=""ltr"">"
- Dim grid As String = "<div align=""center""><div style=""border-bottom: rgb(161,194,224) 1px solid; text-align: left; border-left: rgb(161,194,224) 1px solid; padding-bottom: 3px; margin: 0px; padding-left: 3px; width: auto; padding-right: 3px; background: rgb(255,255,255); overflow: auto; border-top: rgb(161,194,224) 1px solid; border-right: rgb(161,194,224) 1px solid; padding-top: 3px; moz-background-clip: border; moz-background-origin: padding; moz-background-inline-policy: continuous"" dir=""ltr"">"
- style &= grid
- style &= "<font size=""" & My.Settings.FontSize & """><div dir=""ltr"" "
- Dim step2 As String = step1.Replace("</style><div ", style)
- Dim step3 As String = step2.Replace("</ol></div>", "</ol></div></font></div></div>")
- Dim step4 As String = step3.Replace("<ol>", String.Empty).Replace("</ol>", String.Empty)
- Dim step5 As String = step4.Replace("<li class", "<font face=""courier new""><div class").Replace("</li>", "</div></font>")
- Return step5
- End If
- End Function
Add Comment
Please, Sign In to add comment