[smuxi/experiments/any_server_support: 15/34] Engine: support and link RFC section and pages



commit 4f35673d7eb511db3b88df25f2c68d8e9a2fdef1
Author: Mirco Bauer <meebey meebey net>
Date:   Sun Jan 19 20:55:08 2014 +0100

    Engine: support and link RFC section and pages

 src/Engine/Config/MessageBuilderSettings.cs |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/src/Engine/Config/MessageBuilderSettings.cs b/src/Engine/Config/MessageBuilderSettings.cs
index ee1c435..17076fa 100644
--- a/src/Engine/Config/MessageBuilderSettings.cs
+++ b/src/Engine/Config/MessageBuilderSettings.cs
@@ -126,7 +126,18 @@ namespace Smuxi.Engine
             });
 
             // RFCs
-            regex = new Regex(@"RFC[ -]?([0-9]+)", RegexOptions.Compiled);
+            regex = new Regex(@"RFC[ -]?([0-9]+) (?:s\.|ss\.|sec\.|sect\.|section) ?([1-9][0-9.]*)",
+                              RegexOptions.IgnoreCase | RegexOptions.Compiled);
+            BuiltinSmartLinks.Add(new SmartLink(regex) {
+                LinkFormat = "http://tools.ietf.org/html/rfc{1}#section-{2}";
+            });
+            regex = new Regex(@"RFC[ -]?([0-9]+) (?:p\.|pp\.|page) ?(" + short_number + ")",
+                              RegexOptions.IgnoreCase | RegexOptions.Compiled);
+            BuiltinSmartLinks.Add(new SmartLink(regex) {
+                LinkFormat = "http://tools.ietf.org/html/rfc{1}#page-{2}";
+            });
+            regex = new Regex(@"RFC[ -]?([0-9]+)",
+                              RegexOptions.IgnoreCase | RegexOptions.Compiled);
             BuiltinSmartLinks.Add(new SmartLink(regex) {
                 LinkFormat = "http://www.ietf.org/rfc/rfc{1}.txt";
             });


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]