code タグのバグ修正

k_kazu  2008/08/17 14:24 

BlogEngine.Net で 1つのブログの中に複数の [code] タグを入れると 中のコードが消えることがあります。

これを修正するには [ App_Code/Extensions/CodeFormater/CodeFormatter.cs : 46 行目 付近 を修正します。

    private Regex codeBeginTagRegex = new Regex(@"(<p>\r\n<div class=""code"">\n\[code:[a-z#]*?\](\s|)\r\n</p>\r\n|<p>\r\n<div class=""code"">\n\[code:[a-z#]*?\](\s|)<br /><br /><br />)",
    RegexOptions.Compiled
    | RegexOptions.CultureInvariant
    | RegexOptions.IgnoreCase
    | RegexOptions.Singleline);

 

RegEx で  \[code:.*?\] となっている部分を \[code:[a-z#]*?\] に変更しました。
. ( ピリオド ) の部分が次の [code] タグの終了まで マッチするのが原因のようです。

 

Tags:

BlogEngine.Net

Add comment




biuquote
Loading



Copyright (C) 2007 - 2008 www.hiro3-soft.com , All rights reserved.
Powered by BlogEngine.NET 1.6.1.0