Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fixes for <syntax block=yes> case

  • Loading branch information...
commit b2aa6a688b78f0ba088e53c46ed08fb605033cb2 1 parent b8d024a
Cliff Wells authored

Showing 1 changed file with 9 additions and 4 deletions. Show diff stats Hide diff stats

  1. +9 4 nginx-wiki.rules
13 nginx-wiki.rules
@@ -75,8 +75,8 @@ collapsible = "wikitable mw-collapsible mw-collapsed"
75 75 sanitize = True
76 76 collapse = True
77 77 strip = True
78   - _isblock = elem.get ('block') == 'yes'
79   - format = "{{ {0} }}" if _isblock else None
  78 + # _isblock = elem.get ('block') == 'yes'
  79 + # format = "{{ {0} }}" if _isblock else None
80 80 _prev = elem.getprevious ().tag if elem.getprevious () is not None else elem.getparent ().tag
81 81 _name = "'''{0}''' ".format (elem.xpath ('ancestor::directive')[0].get ('name'))
82 82 _tag = elem.tag.capitalize ().replace ('-', ' ')
@@ -85,8 +85,10 @@ collapsible = "wikitable mw-collapsible mw-collapsed"
85 85 sanitize = True
86 86 collapse = True
87 87 strip = True
  88 + _isblock = elem.get ('block') == 'yes'
  89 + _block = "{ ... }" if _isblock else ""
88 90 _next = elem.getnext ().tag if elem.getnext() is not None else ""
89   - suffix = "" if _next == elem.tag else "</td></tr>"
  91 + suffix = _block if _next == elem.tag else "{0}</td></tr>".format (_block)
90 92
91 93 ~ /syntax(\[\d+\])?$
92 94 start:
@@ -101,8 +103,11 @@ collapsible = "wikitable mw-collapsible mw-collapsed"
101 103 sanitize = True
102 104 collapse = True
103 105 strip = True
  106 + _isblock = elem.get ('block') == 'yes'
  107 + _block = "{ ... }" if _isblock else ""
104 108 _next = elem.getnext ().tag if elem.getnext() is not None else ""
105   - suffix = "" if _next == elem.tag else "</td></tr>"
  109 + suffix = _block if _next == elem.tag else "{0}</td></tr>".format (_block)
  110 +
106 111
107 112 #
108 113 # context

0 comments on commit b2aa6a6

Please sign in to comment.
Something went wrong with that request. Please try again.