Guest User

Untitled

a guest
Jan 21st, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.94 KB | None | 0 0
  1.     Private Function NormalizeCode(ByVal code As String) As String
  2.         If code = String.Empty Then
  3.             Return String.Empty
  4.         Else
  5.             'Replace font
  6.             Dim step1 As String = code '.Replace("monospace", """Courier New""")
  7.             'Build a string of style
  8.             Dim style As String = "</style>"
  9.             '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"">"
  10.             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"">"
  11.             style &= grid
  12.             style &= "<font size=""" & My.Settings.FontSize & """><div dir=""ltr"" "
  13.             Dim step2 As String = step1.Replace("</style><div ", style)
  14.             Dim step3 As String = step2.Replace("</ol></div>", "</ol></div></font></div></div>")
  15.             Dim step4 As String = step3.Replace("<ol>", String.Empty).Replace("</ol>", String.Empty)
  16.             Dim step5 As String = step4.Replace("<li class", "<font face=""courier new""><div class").Replace("</li>", "</div></font>")
  17.             Return step5
  18.         End If
  19.     End Function
Add Comment
Please, Sign In to add comment