Example #1
0
        public void MappingCanBeReconfigured_HandlesRemovedMappings()
        {
            SmartyPantOptions options = new SmartyPantOptions();

            options.Mapping.Remove(SmartyPantType.LeftAngleQuote);
            options.Mapping.Remove(SmartyPantType.RightAngleQuote);

            var pipeline = new MarkdownPipelineBuilder()
                           .UseSmartyPants(options)
                           .Build();

            TestParser.TestSpec("<<test>>", "<p>&laquo;test&raquo;</p>", pipeline);
        }
Example #2
0
        public void MappingCanBeReconfigured()
        {
            SmartyPantOptions options = new SmartyPantOptions();

            options.Mapping[SmartyPantType.LeftAngleQuote]  = "foo";
            options.Mapping[SmartyPantType.RightAngleQuote] = "bar";

            var pipeline = new MarkdownPipelineBuilder()
                           .UseSmartyPants(options)
                           .Build();

            TestParser.TestSpec("<<test>>", "<p>footestbar</p>", pipeline);
        }
Example #3
0
 /// <summary>
 /// Uses the SmartyPants extension.
 /// </summary>
 /// <param name="pipeline">The pipeline.</param>
 /// <param name="options">The options.</param>
 /// <returns>
 /// The modified pipeline
 /// </returns>
 public static MarkdownPipelineBuilder UseSmartyPants(this MarkdownPipelineBuilder pipeline, SmartyPantOptions options = null)
 {
     if (!pipeline.Extensions.Contains <SmartyPantsExtension>())
     {
         pipeline.Extensions.Add(new SmartyPantsExtension(options));
     }
     return(pipeline);
 }