public static string md(this string s) { bool e = false, b = false; Buffer sb = new Buffer(s); for (int i=1;i<s.Length;++i) { var t = s[i]; if (marks.IndexOf(t)<0) continue; var r = (string) s[i-1]; if (r==@"\") continue; if (t!='*' || t!='_') continue; // for now if ((r=="*" && t=='*')) { b = !b; } else if (t=='*') e = !e; } return sb.ToString(); }