Skip to content

Commit

Permalink
Change unknown tags option throw->raise
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticmind committed Jan 4, 2018
1 parent 6d1255d commit 7e2ec87
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/ReverseMarkdown.Test/ConverterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,10 @@ public void Check_Converter_With_Unknown_Tag_PassThrough_Option()
}

[Fact]
public void Check_Converter_With_Unknown_Tag_Throw_Option()
public void Check_Converter_With_Unknown_Tag_Raise_Option()
{
const string html = @"<unknown-tag>text in unknown tag</unknown-tag><p>paragraph text</p>";
var config = new Config("throw");
var config = new Config("raise");
var converter = new Converter(config);
Exception ex = Assert.Throws<UnknownTagException>(() => converter.Convert(html));
Assert.Equal("Unknown tag: unknown-tag", ex.Message);
Expand All @@ -327,7 +327,7 @@ public void Check_Converter_With_UnknownTags_Invalid_Option_Value()
{
var config = new Config("invalid_option");
Exception ex = Assert.Throws<InvalidConfigurationException>(() => new Converter(config));
Assert.Equal("Invalid UnknownTags config: valid values are pass_through,drop,bypass,throw", ex.Message);
Assert.Equal("Invalid UnknownTags config: valid values are pass_through,drop,bypass,raise", ex.Message);
}

private static void CheckConversion(string html, string expected)
Expand Down
2 changes: 1 addition & 1 deletion src/ReverseMarkdown/Converter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public Converter(Config config)
{
this._config = config;

var unknownTagsConfigOptions = new List<string>() { "pass_through", "drop", "bypass", "throw" };
var unknownTagsConfigOptions = new List<string>() { "pass_through", "drop", "bypass", "raise" };

// check if the passed unknown tags config is valid
if (!unknownTagsConfigOptions.Contains(this._config.UnknownTags))
Expand Down

0 comments on commit 7e2ec87

Please sign in to comment.