Browse Source

Bugfix for include filenames containing quotes. Changes for #32.

tags/0.13
Frans Bouma 10 years ago
parent
commit
13ab6f0f15
4 changed files with 16 additions and 6 deletions
  1. +9
    -0
      src/DocNet/Config.cs
  2. +2
    -2
      src/DocNet/Properties/AssemblyInfo.cs
  3. +1
    -1
      src/DocNet/SimpleNavigationElement.cs
  4. +4
    -3
      src/DocNet/Utils.cs

+ 9
- 0
src/DocNet/Config.cs View File

@@ -198,6 +198,15 @@ namespace Docnet
return _destinationPath;
}
}

public string IncludeFolder
{
get
{
string rawIncludeFolder = _configData.IncludeSource;
return string.IsNullOrWhiteSpace(rawIncludeFolder) ? "Includes" : rawIncludeFolder;
}
}
public string ThemeName
{


+ 2
- 2
src/DocNet/Properties/AssemblyInfo.cs View File

@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.10.1.0")]
[assembly: AssemblyFileVersion("0.10.1")]
[assembly: AssemblyVersion("0.11.0.0")]
[assembly: AssemblyFileVersion("0.11.0")]

+ 1
- 1
src/DocNet/SimpleNavigationElement.cs View File

@@ -67,7 +67,7 @@ namespace Docnet
{
this.MarkdownFromFile = File.ReadAllText(sourceFile);
// Check if the content contains @@include tag
content = Utils.IncludeProcessor(this.MarkdownFromFile, Path.Combine(activeConfig.Source, "Includes"));
content = Utils.IncludeProcessor(this.MarkdownFromFile, Utils.MakeAbsolutePath(activeConfig.Source, activeConfig.IncludeFolder));
content = Utils.ConvertMarkdownToHtml(content, Path.GetDirectoryName(destinationFile), activeConfig.Destination, _relativeH2LinksOnPage);
}
else


+ 4
- 3
src/DocNet/Utils.cs View File

@@ -212,9 +212,9 @@ namespace Docnet
/// into the output.
/// </summary>
/// <param name="content">content to be scanned for include tags</param>
/// <param name="includePath">Directory containing the include files</param>
/// <param name="includeFolder">Directory containing the include files (absolute folder)</param>
/// <returns>String with @@include replaced with the actual content from the partial.</returns>
public static string IncludeProcessor(String content, string includePath)
public static string IncludeProcessor(String content, string includeFolder)
{
Match m = includeRegex.Match(content);
while (m.Success)
@@ -223,7 +223,8 @@ namespace Docnet
{
string tagToReplace = m.Groups[0].Value;
string fileName = m.Groups[1].Value;
string filePath = Path.Combine(includePath, fileName);
fileName = fileName.Replace("\"", "");
string filePath = Path.Combine(includeFolder, fileName);
if (File.Exists(filePath))
{
content = content.Replace(tagToReplace, File.ReadAllText(filePath));


Loading…
Cancel
Save