Browse Source

#13: Přidáno deprecation varování do původní html funkce.

pull/28/head
Jan Černohorský 1 year ago
parent
commit
cfbe3e128d
  1. 5
      src/formatitko/html.py

5
src/formatitko/html.py

@ -13,8 +13,13 @@ from .util import inlinify
from .context import Group from .context import Group
from .images import ImageProcessor from .images import ImageProcessor
import warnings
warnings.warn("The html function has been deprecated, is left only for reference and will be removed in future commits. HTML_generator should be used in its place.", DeprecationWarning)
def html(e: Union[Element, ListContainer], k: KatexClient, i: ImageProcessor, indent_level: int=0, indent_str: str="\t") -> str: def html(e: Union[Element, ListContainer], k: KatexClient, i: ImageProcessor, indent_level: int=0, indent_str: str="\t") -> str:
warnings.warn("The html function has been deprecated, is left only for reference and will be removed in future commits. HTML_generator should be used in its place.", DeprecationWarning)
# `only` attribute which makes transformed elements appear only in tex # `only` attribute which makes transformed elements appear only in tex
# output or html output # output or html output
if hasattr(e, "attributes") and "only" in e.attributes and e.attributes["only"] != "html": if hasattr(e, "attributes") and "only" in e.attributes and e.attributes["only"] != "html":

Loading…
Cancel
Save