texinfo-commits
[Top][All Lists]
Advanced

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

[5893] check for whitespace after reference marker


From: Gavin D. Smith
Subject: [5893] check for whitespace after reference marker
Date: Sun, 26 Oct 2014 21:56:00 +0000

Revision: 5893
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5893
Author:   gavin
Date:     2014-10-26 21:55:59 +0000 (Sun, 26 Oct 2014)
Log Message:
-----------
check for whitespace after reference marker

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/info-utils.c
    trunk/info/nodes.h

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2014-10-26 18:19:52 UTC (rev 5892)
+++ trunk/ChangeLog     2014-10-26 21:55:59 UTC (rev 5893)
@@ -1,3 +1,13 @@
+2014-10-26  Gavin Smith  <address@hidden>
+
+       * info/info-utils.c (scan_reference_marker) Return value says 
+       whether syntax was valid.
+       <cross-references>: Demand that cross-reference marker is 
+       followed by whitespace.
+       (scan_node_contents): Call to scan_reference_marker updated.
+       * info/nodes.h (INFO_MENU_REGEXP, INFO_MENU_ENTRY_REGEXP)
+       (INFO_XREF_REGEXP, INFO_TAG_REGEXP): Removed.
+
 2014-10-26  Karl Berry  <address@hidden>
 
        * Texinfo/Convert/DocBook.pm (upper_case_style_commands),

Modified: trunk/info/info-utils.c
===================================================================
--- trunk/info/info-utils.c     2014-10-26 18:19:52 UTC (rev 5892)
+++ trunk/info/info-utils.c     2014-10-26 21:55:59 UTC (rev 5893)
@@ -1200,7 +1200,7 @@
 /* Output, replace or hide text introducing a reference.  inptr starts on
    the first byte of a sequence introducing a reference and finishes on the
    first (non-whitespace) byte of the reference label. */
-static void
+static int
 scan_reference_marker (REFERENCE *entry)
 {
   /* When preprocess_nodes is Off, we position the cursor on
@@ -1224,6 +1224,15 @@
     {
       int previous_word_is_like_see = 0;
 
+      /* Only match "*Note" if it is followed by a whitespace character so 
that 
+         it will not be recognized if, e.g., it is surrounded in inverted 
+         commas. */
+      if (!strchr (" \t\r\n", inptr[strlen ("*Note")]))
+        {
+          copy_input_to_output (strlen ("*Note:"));
+          return 0;
+        }
+
       /* Cross-references can be generated by four different Texinfo
          commands.  @inforef and @xref output "*Note " in Info format,
          and "See" in HTML and print.  @ref and @pxref output "*note "
@@ -1238,7 +1247,6 @@
         write_extra_bytes_to_output ("See", 3);
       else
         {
-
           previous_word_is_like_see = avoid_see_see (inptr, input_start);
 
           if (!previous_word_is_like_see)
@@ -1252,6 +1260,8 @@
 
   /* Copy any white space before label. */
   copy_input_to_output (skip_whitespace_and_newlines (inptr));
+
+  return 1;
 }
 
 /* Output reference label and update ENTRY.  INPTR should be on the first
@@ -1697,12 +1707,13 @@
             in_parentheses = 1;
 
           save_conversion_state ();
-          scan_reference_marker (entry);
-
-          if (!scan_reference_label (entry)
+          
+          if (!scan_reference_marker (entry)
+              || !scan_reference_label (entry)
               || !scan_reference_target (entry, node, in_parentheses))
             {
-              /* This is not a menu entry or reference.  Do not add to our 
list. */
+              /* This is not a menu entry or reference.  Do not add to our 
+                 list. */
               char *cur_inptr = inptr;
               reset_conversion ();
               copy_input_to_output (cur_inptr - inptr);

Modified: trunk/info/nodes.h
===================================================================
--- trunk/info/nodes.h  2014-10-26 18:19:52 UTC (rev 5892)
+++ trunk/info/nodes.h  2014-10-26 21:55:59 UTC (rev 5893)
@@ -90,14 +90,8 @@
 #define INFO_NEXT_LABEL                 "Next:"
 #define INFO_UP_LABEL                   "Up:"
 #define INFO_MENU_LABEL                 "\n* Menu:"
-#define INFO_MENU_REGEXP                "\n\\* Menu:"
 #define INFO_MENU_ENTRY_LABEL           "\n* "
-#define INFO_MENU_ENTRY_REGEXP          "\n\\* "
 #define INFO_XREF_LABEL                 "*Note"
-/* Only match "*Note" if it is followed by a whitespace character so that it
-   will not be recognized if, e.g., it is surrounded in inverted commas. */
-#define INFO_XREF_REGEXP                "\\*Note[ \\t\\n]"
-#define INFO_TAG_REGEXP                 " \010\\["
 #define TAGS_TABLE_END_LABEL            "\nEnd Tag Table"
 #define TAGS_TABLE_BEG_LABEL            "Tag Table:\n"
 #define INDIRECT_TAGS_TABLE_LABEL       "Indirect:\n"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]