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

This commit is contained in:
Jan Černohorský 2024-02-27 16:24:27 +01:00
parent 583b3ba010
commit 42d04b77de
2 changed files with 4 additions and 2 deletions

View file

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

View file

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