Skip to content
This repository has been archived by the owner on Jun 6, 2021. It is now read-only.

Commit

Permalink
Fixed HTML convert + file checker
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackDragonBE committed Nov 21, 2018
1 parent c9fb2ff commit afe3be1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions MarkdownToRW/MarkdownConverter/ContentScan/ContentScanner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,14 @@ private static void ScanWords(ref ScanResults results, string markdownText)
{
if (britshAmericanWordsDict.ContainsKey(word.ToLower()))
{
string american = britshAmericanWordsDict[word];
string american = britshAmericanWordsDict[word.ToLower()];
results.ProblemsFound.Add("British word found: '" + word + "'. Please replace this with '" +
american + "'.");
}

if (commonMisspelledWordsDict.ContainsKey(word.ToLower()))
{
string correctSpelling = commonMisspelledWordsDict[word];
string correctSpelling = commonMisspelledWordsDict[word.ToLower()];
results.ProblemsFound.Add("Incorrectly spelled word found: '" + word +
"'. Please replace this with '" + correctSpelling + "'.");
}
Expand Down
5 changes: 2 additions & 3 deletions MarkdownToRW/MarkdownConverter/DragonConverter/Converter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public static string ConvertMarkdownStringToHtml(string markdown, ConverterOptio
//MarkdownPipeline pipeline = new MarkdownPipelineBuilder().UseAdvancedExtensions().Build();
MarkdownPipeline pipeline = new MarkdownPipelineBuilder().UseEmphasisExtras().UseCustomContainers().Build();


string output = Markdown.ToHtml(markdown, pipeline);
//Console.WriteLine(output);

Expand All @@ -37,6 +36,7 @@ public static string ConvertMarkdownStringToHtml(string markdown, ConverterOptio

// Add attributes
AddClassToImages(ref output, options.FirstImageIsAlignedRight, rootPath);

AddExtraAttributesToLinks(ref output);

// Make new lines consistent across platforms
Expand Down Expand Up @@ -81,7 +81,6 @@ public static string ConvertMarkdownStringToHtml(string markdown, ConverterOptio
output = WebUtility.HtmlDecode(output);
}


output = output.Trim();
return output;
}
Expand Down Expand Up @@ -118,7 +117,7 @@ private static void AddClassToImages(ref string html, bool firstImageRightAligne
HtmlNode node = imgNodes[i];

// If root path is known, check if images are too big for full size class
if (rootPath != null)
if (rootPath != null && File.Exists(DragonUtil.GetFullFilePath(node.Attributes["src"].Value, rootPath)))
{
var imageSize = ImageHelper.GetDimensions(DragonUtil.GetFullFilePath(node.Attributes["src"].Value, rootPath));

Expand Down
2 changes: 1 addition & 1 deletion MarkdownToRW/MarkdownConverter/DragonVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ namespace DragonMarkdown
{
public static class DragonVersion
{
public static readonly decimal VERSION = 1.18m;
public static readonly decimal VERSION = 1.19m;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ public GetProfileResponse SendGetProfileRequest(GetProfileRequest request)
// Get response
var rpcResponse = rpcClient.Execute<RpcResponseValue<string>>(rpcRequest);

Console.WriteLine("RESPONSE:");
Console.WriteLine(rpcResponse.Content);

// Find and fill members in
XmlMemberSearcher searcher = new XmlMemberSearcher(rpcResponse.Content);
response.Bio = searcher.GetValueOfMember("bio");
Expand Down

0 comments on commit afe3be1

Please sign in to comment.