Quellcode durchsuchen

Implement _blank_param_value().

tags/v0.1
Ben Kurtovic vor 12 Jahren
Ursprung
Commit
16a58a8c3b
1 geänderte Dateien mit 6 neuen und 3 gelöschten Zeilen
  1. +6
    -3
      mwparserfromhell/nodes/template.py

+ 6
- 3
mwparserfromhell/nodes/template.py Datei anzeigen

@@ -20,7 +20,9 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE. # SOFTWARE.


from mwparserfromhell.nodes import HTMLEntity, Node
import re

from mwparserfromhell.nodes import HTMLEntity, Node, Text
from mwparserfromhell.nodes.extras import Parameter from mwparserfromhell.nodes.extras import Parameter
from mwparserfromhell.utils import parse_anything from mwparserfromhell.utils import parse_anything


@@ -47,8 +49,9 @@ class Template(Node):
if char in node: if char in node:
code.replace(node, node.replace(char, replacement)) code.replace(node, node.replace(char, replacement))


def _blank_param_value(self, value): # TODO
pass # MAKE VALUE CONTAIN ABSOLUTELY TWO TEXT NODES: FIRST IS SPACING BEFORE CHUNK AND SECOND IS SPACING AFTER CHUNK
def _blank_param_value(self, value):
match = re.search("^(\s*).*?(\s*)$", value, re.DOTALL|re.UNICODE)
value.nodes = [Text(match.group(1)), Text(match.group(2))]


@property @property
def name(self): def name(self):


Laden…
Abbrechen
Speichern