Browse Source

Added title attribute for images, fixed formatting of raw blocks.

master
Jan Černohorský 8 months ago
parent
commit
42d04b77de
  1. 2
      src/formatitko/html_generator.py
  2. 4
      src/formatitko/output_generator.py

2
src/formatitko/html_generator.py

@ -194,6 +194,8 @@ class HTMLGenerator(OutputGenerator):
attributes["width"] = e.attributes["width"]
if "height" in e.attributes:
attributes["height"] = e.attributes["height"]
if "title" in e.attributes:
attributes["title"] = e.attributes["title"]
if e.title:
attributes["alt"] = e.title

4
src/formatitko/output_generator.py

@ -272,9 +272,9 @@ class OutputGenerator:
self.write(self.end_tag(tag))
def generate_raw_block_tag(self, tag: str, text: str, attributes: dict[str,str]={}):
self.writeln(self.start_tag(tag, attributes))
self.writeraw(self.start_tag(tag, attributes))
self.writeraw(text)
self.writeln(self.end_tag(tag))
self.writeraw(self.end_tag(tag))
def generate_empty_block_tag(self, tag: str, attributes: dict[str,str]={}):
self.writeln(self.single_tag(tag, attributes))

Loading…
Cancel
Save