Procházet zdrojové kódy

Fix a regexp in HTML and DocBook exporters

* lisp/org-docbook.el (org-export-as-docbook): Fix regexp.
* lisp/org-html.el (org-export-as-html): Fix regexp.

The erroneous regexp would identify the string " *" as an headline.
Nicolas Goaziou před 13 roky
rodič
revize
679a0e1fe9
2 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. 1 1
      lisp/org-docbook.el
  2. 1 1
      lisp/org-html.el

+ 1 - 1
lisp/org-docbook.el

@@ -970,7 +970,7 @@ publishing directory."
 		    (push (cons num 1) footref-seen))))))
 
 	  (cond
-	   ((string-match "\\(\\*+\\)\\(?: +\\(.*?\\)\\)?[ \t]*$" line)
+	   ((string-match "^\\(\\*+\\)\\(?: +\\(.*?\\)\\)?[ \t]*$" line)
 	    ;; This is a headline
 	    (setq level (org-tr-level (- (match-end 1) (match-beginning 1)
 					 level-offset))

+ 1 - 1
lisp/org-html.el

@@ -1648,7 +1648,7 @@ PUB-DIR is set, use this as the publishing directory."
 			 t t line))))))
 
 	  (cond
-	   ((string-match "\\(\\*+\\)\\(?: +\\(.*?\\)\\)?[ \t]*$" line)
+	   ((string-match "^\\(\\*+\\)\\(?: +\\(.*?\\)\\)?[ \t]*$" line)
 	    ;; This is a headline
 	    (setq level (org-tr-level (- (match-end 1) (match-beginning 1)
 					 level-offset))