PandocProcessor nyní předělává i NBSP.

This commit is contained in:
Jan Černohorský 2023-09-20 22:09:03 +02:00
parent 0dcad55bb8
commit 20c1ba29a2

View file

@ -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