Convert plain text to HTML C# I have the ToHtml() Extension Method

public static class StringMethodExtensions
{
    private static string _paraBreak = "\r\n\r\n";
    private static string _link = "&lt;a href=\"{0}\"&gt;{1}&lt;/a&gt;";
    private static string _linkNoFollow = "&lt;a href=\"{0}\" rel=\"nofollow\"&gt;{1}&lt;/a&gt;";

    /// &lt;summary&gt;
    /// Returns a copy of this string converted to HTML markup.
    /// &lt;/summary&gt;
    public static string ToHtml(this string s)
    {
        return ToHtml(s, false);
    }

    /// &lt;summary&gt;
    /// Returns a copy of this string converted to HTML markup.
    /// &lt;/summary&gt;
    /// &lt;param name="nofollow"&gt;If true, links are given "nofollow"
    /// attribute&lt;/param&gt;
    public static string ToHtml(this string s, bool nofollow)
    {
        StringBuilder sb = new StringBuilder();

        int pos = 0;
        while (pos &lt; s.Length)
        {
            // Extract next paragraph
            int start = pos;
            pos = s.IndexOf(_paraBreak, start);
            if (pos &lt; 0)
                pos = s.Length;
            string para = s.Substring(start, pos - start).Trim();

            // Encode non-empty paragraph
            if (para.Length &gt; 0)
                EncodeParagraph(para, sb, nofollow);

            // Skip over paragraph break
            pos += _paraBreak.Length;
        }
        // Return result
        return sb.ToString();
    }

    /// &lt;summary&gt;
    /// Encodes a single paragraph to HTML.
    /// &lt;/summary&gt;
    /// &lt;param name="s"&gt;Text to encode&lt;/param&gt;
    /// &lt;param name="sb"&gt;StringBuilder to write results&lt;/param&gt;
    /// &lt;param name="nofollow"&gt;If true, links are given "nofollow"
    /// attribute&lt;/param&gt;
    private static void EncodeParagraph(string s, StringBuilder sb, bool nofollow)
    {
        // Start new paragraph
        sb.AppendLine("&lt;p&gt;");

        // HTML encode text
        s = HttpUtility.HtmlEncode(s);

        // Convert single newlines to &lt;br&gt;
        s = s.Replace(Environment.NewLine, "&lt;br /&gt;\r\n");

        // Encode any hyperlinks
        EncodeLinks(s, sb, nofollow);

        // Close paragraph
        sb.AppendLine("\r\n&lt;/p&gt;");
    }

    /// &lt;summary&gt;
    /// Encodes [[URL]] and [[Text][URL]] links to HTML.
    /// &lt;/summary&gt;
    /// &lt;param name="text"&gt;Text to encode&lt;/param&gt;
    /// &lt;param name="sb"&gt;StringBuilder to write results&lt;/param&gt;
    /// &lt;param name="nofollow"&gt;If true, links are given "nofollow"
    /// attribute&lt;/param&gt;
    private static void EncodeLinks(string s, StringBuilder sb, bool nofollow)
    {
        // Parse and encode any hyperlinks
        int pos = 0;
        while (pos &lt; s.Length)
        {
            // Look for next link
            int start = pos;
            pos = s.IndexOf("[[", pos);
            if (pos &lt; 0)
                pos = s.Length;
            // Copy text before link
            sb.Append(s.Substring(start, pos - start));
            if (pos &lt; s.Length)
            {
                string label, link;

                start = pos + 2;
                pos = s.IndexOf("]]", start);
                if (pos &lt; 0)
                    pos = s.Length;
                label = s.Substring(start, pos - start);
                int i = label.IndexOf("][");
                if (i &gt;= 0)
                {
                    link = label.Substring(i + 2);
                    label = label.Substring(0, i);
                }
                else
                {
                    link = label;
                }
                // Append link
                sb.Append(String.Format(nofollow ? _linkNoFollow : _link, link, label));

                // Skip over closing "]]"
                pos += 2;
            }
        }
    }
}


Do you see any improvement / issue?
public static string ToHtml(this string s, bool nofollow)
{
    s = HttpUtility.HtmlEncode(s);
    string[] paragraphs = s.Split(new string[]{"\r\n\r\n"}, StringSplitOptions.None);
    StringBuilder sb = new StringBuilder();
    foreach (string par in paragraphs) {
        sb.AppendLine("&lt;p&gt;");
        string p = par.Replace(Environment.NewLine, "&lt;br /&gt;\r\n");
        if (nofollow) {
            p = Regex.Replace(p, @"\[\[(.+)\]\[(.+)\]\]", "&lt;a href=\"$2\" rel=\"nofollow\"&gt;$1&lt;/a&gt;");
            p = Regex.Replace(p, @"\[\[(.+)\]\]", "&lt;a href=\"$1\" rel=\"nofollow\"&gt;$1&lt;/a&gt;");
        } else {
            p = Regex.Replace(p, @"\[\[(.+)\]\[(.+)\]\]", "&lt;a href=\"$2\"&gt;$1&lt;/a&gt;");
            p = Regex.Replace(p, @"\[\[(.+)\]\]", "&lt;a href=\"$1\"&gt;$1&lt;/a&gt;");
            sb.AppendLine(p);
        }
        sb.AppendLine("&lt;/p&gt;");
    }
    return sb.ToString();
}


In general, if you find yourself with a variable that you pass around through a bunch of static methods (like nofollow), it may be time to make those methods not static.