changeset 1560:96c55e665a55

Improve TFdoc syntax.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 19 Apr 2013 16:05:12 +0300
parents 4912cac99455
children 22830172da4e
files docs/tfdoc.pl
diffstat 1 files changed, 20 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/docs/tfdoc.pl	Fri Apr 19 15:29:41 2013 +0300
+++ b/docs/tfdoc.pl	Fri Apr 19 16:05:12 2013 +0300
@@ -2,7 +2,7 @@
 #
 # TFDoc for extending GgrTF DocBook manual with embedded TF docs.
 # Programmed by Matti 'ccr' Hamalainen <ccr@tnsp.org>
-# (C) Copyright 2009 Tecnic Software productions (TNSP)
+# (C) Copyright 2009-2013 Tecnic Software productions (TNSP)
 #
 use strict;
 use warnings;
@@ -22,14 +22,30 @@
 }
 
 my %xentities = (
-  "&" => "amp",
+  "&" => "&amp;",
+  "ยง" => "",
 );
 
 sub xmlentities2($)
 {
   my $value = $_[0];
-  $value =~ s/$_/\&$xentities{$_}\;/g foreach (keys %xentities);
-  return $value;
+  $value =~ s/$_/$xentities{$_}/g foreach (keys %xentities);
+
+  my $str = "";
+  my $state = 0;
+  foreach my $qch (split(//, $value))
+  {
+    if ($qch eq "\$")
+    {
+      $state = !$state;
+      $str .= ($state ? "<emphasis>" : "</emphasis>");
+    }
+    else
+    {
+      $str .= $qch;
+    }
+  }
+  return $str;
 }