Browse Source

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 8 years ago
parent
commit
679a0e1fe9
2 changed files with 2 additions and 2 deletions
  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))