diff --git a/GenerateHighlightContent/HighLightSection.cs b/GenerateHighlightContent/HighLightSection.cs index 2a687bd..3c6f84a 100644 --- a/GenerateHighlightContent/HighLightSection.cs +++ b/GenerateHighlightContent/HighLightSection.cs @@ -19,6 +19,9 @@ public override bool IsReadOnly() [ConfigurationProperty("ProcessName", DefaultValue = "highlight.exe")] public string ProcessName { get { return base["ProcessName"].ToString(); } } + [ConfigurationProperty("ThemeFolder", DefaultValue = "themes")] + public string ThemeFolder { get { return base["ThemeFolder"].ToString(); } } + [ConfigurationProperty("GeneralArguments", IsRequired = true, IsDefaultCollection = true)] public GeneralArgumentsCollection GeneralArguments { diff --git a/GenerateHighlightContent/Properties/AssemblyInfo.cs b/GenerateHighlightContent/Properties/AssemblyInfo.cs index 1fb2226..b9a4279 100644 --- a/GenerateHighlightContent/Properties/AssemblyInfo.cs +++ b/GenerateHighlightContent/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // 您可以指定所有的值,也可以依照以下的方式,使用 '*' 將組建和修訂編號 // 指定為預設值: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.0.0.0")] -[assembly: AssemblyFileVersion("2.0.0.0")] +[assembly: AssemblyVersion("2.3.0.0")] +[assembly: AssemblyFileVersion("2.3.0.0")] diff --git a/NoteHighlightAddin/AddIn.cs b/NoteHighlightAddin/AddIn.cs index 428f37c..b341050 100644 --- a/NoteHighlightAddin/AddIn.cs +++ b/NoteHighlightAddin/AddIn.cs @@ -294,9 +294,24 @@ public XDocument InsertHighLightCode(string htmlContent, string[] position, High XElement cell2 = new XElement(ns + "Cell"); cell2.Add(new XAttribute("shadingColor", colorString)); + string defaultStyle = ""; + var arrayLine = htmlContent.Split(new string[] { Environment.NewLine }, StringSplitOptions.None); - foreach (var item in arrayLine) + foreach (var it in arrayLine) { + string item = it; + + if(item.StartsWith("
") + { + continue; + } + var itemNr = ""; var itemLine = ""; if (parameters.ShowLineNumber) @@ -313,8 +328,9 @@ public XDocument InsertHighLightCode(string htmlContent, string[] position, High itemLine = item; } - string nr = string.Format(@"", GenerateHighlightContent.GenerateHighLight.Config.OutputArguments["Font"].Value) + - itemNr.Replace("'", "'") + ""; + //string nr = string.Format(@"", GenerateHighlightContent.GenerateHighLight.Config.OutputArguments["Font"].Value) + + // itemNr.Replace("'", "'") + ""; + string nr = defaultStyle + itemNr.Replace("'", "'") + ""; cell1.Add(new XElement(ns + "OEChildren", new XElement(ns + "OE", @@ -326,8 +342,9 @@ public XDocument InsertHighLightCode(string htmlContent, string[] position, High itemLine = item; } //string s = item.Replace(@"style=""", string.Format(@"style=""font-family:{0}; ", GenerateHighlightContent.GenerateHighLight.Config.OutputArguments["Font"].Value)); - string s = string.Format(@"", GenerateHighlightContent.GenerateHighLight.Config.OutputArguments["Font"].Value) + - itemLine.Replace("'", "'") + ""; + //string s = string.Format(@"", GenerateHighlightContent.GenerateHighLight.Config.OutputArguments["Font"].Value) + + // itemLine.Replace("'", "'") + ""; + string s = defaultStyle + itemLine.Replace("'", "'") + "