# HG changeset patch # User Paul Boddie # Date 1533678324 -7200 # Node ID ce03509263ef6c45ed491594c68e0b0146ea1291 # Parent bc7fb867436e24d903bed509c0d854f12f0c73af# Parent d9f2d31daebdf39b6e4fdf869426e60bd2637781 Merged changes from the default branch. diff -r bc7fb867436e -r ce03509263ef moinformat/input/directory.py --- a/moinformat/input/directory.py Tue Aug 07 17:07:03 2018 +0200 +++ b/moinformat/input/directory.py Tue Aug 07 23:45:24 2018 +0200 @@ -49,7 +49,9 @@ "Return all pages in the context." - return map(self.to_pagename, self.dir.select_files("*")) + # Ignore dotfiles. + + return map(self.to_pagename, self.dir.select_files("[!.]*")) # Page characteristics. diff -r bc7fb867436e -r ce03509263ef moinformat/parsers/common.py --- a/moinformat/parsers/common.py Tue Aug 07 17:07:03 2018 +0200 +++ b/moinformat/parsers/common.py Tue Aug 07 23:45:24 2018 +0200 @@ -27,6 +27,7 @@ ws_excl_nl = r"[ \f\r\t\v]" quotes = "['" '"]' # ['"] +dotall = r"(.|\n)" def choice(l): @@ -80,6 +81,7 @@ Define patterns for the regular expressions in the 'syntax' mapping. In each pattern, replace... + \E with a pattern for matching all characters including newlines \N with a pattern for matching whitespace excluding newlines \Q with a pattern for matching quotation marks @@ -91,6 +93,7 @@ for name, value in syntax.items(): value = value.replace(r"\N", ws_excl_nl) value = value.replace(r"\Q", quotes) + value = value.replace(r"\E", dotall) # Add the name to group names as a prefix. diff -r bc7fb867436e -r ce03509263ef moinformat/parsers/moin.py --- a/moinformat/parsers/moin.py Tue Aug 07 17:07:03 2018 +0200 +++ b/moinformat/parsers/moin.py Tue Aug 07 23:45:24 2018 +0200 @@ -696,7 +696,8 @@ "link" : join((r"\[\[", # [[ group("target", ".*?"), # target - optional(join((r"\|", group("text", ".*?")))), # | text (optional) + optional(join((r"\|", # | + group("text", r"\E*?")))), # text-incl-nl (optional) "]]")), # ]] "macro" : join(("<<", # << diff -r bc7fb867436e -r ce03509263ef moinformat/serialisers/html/graphviz.py --- a/moinformat/serialisers/html/graphviz.py Tue Aug 07 17:07:03 2018 +0200 +++ b/moinformat/serialisers/html/graphviz.py Tue Aug 07 23:45:24 2018 +0200 @@ -73,7 +73,7 @@ l = ["%s='%s'" % (attrname, escape_attr(target))] for key, value in attributes.items(): l.append("%s='%s'" % (key, value)) - self.out("<%s %s%s>" % (tagname, " ".join(l), closing and " /")) + self.out("<%s %s%s>" % (tagname, " ".join(l), closing and " /" or "")) def image(self, target, attributes): self._tag("img", "src", target, attributes, True)