From 20c1ba29a2c13354d36249dfaaca179fa6669fce Mon Sep 17 00:00:00 2001 From: Greenscreener Date: Wed, 20 Sep 2023 22:09:03 +0200 Subject: [PATCH] =?UTF-8?q?PandocProcessor=20nyn=C3=AD=20p=C5=99ed=C4=9Bl?= =?UTF-8?q?=C3=A1v=C3=A1=20i=20NBSP.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/formatitko/pandoc_processor.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/formatitko/pandoc_processor.py b/src/formatitko/pandoc_processor.py index 32ffb8f..6bcd1d7 100644 --- a/src/formatitko/pandoc_processor.py +++ b/src/formatitko/pandoc_processor.py @@ -2,14 +2,12 @@ from .nop_processor import NOPProcessor from panflute import Div, Span, Null, Str, Plain, Quoted from .context import Group, InlineGroup, BlockGroup from .elements import FQuoted +from .whitespace import NBSP from .nop_processor import ELCl from typing import Callable import sys -def eprint(*args, **kwargs): - print(*args, **kwargs, file=sys.stderr) - class PandocProcessor(NOPProcessor): def get_posttransformers(self) -> list[Callable[[ELCl],ELCl]]: @@ -38,3 +36,6 @@ class PandocProcessor(NOPProcessor): def transform_FQuoted(self, e: FQuoted) -> Quoted: return Quoted(*e.content) + + def transform_NBSP(self, e: NBSP) -> Str: + return Str(" ") # Unicode nbsp