Formátítko si namele hubu, když nespecifikuji jazyk #34

Closed
opened 1 year ago by jirikalvoda · 1 comments
Owner
<main>
Traceback (most recent call last):
  File "/home/jiri/mff/bakararka/zapoctak-past/venv/bin/formatitko", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/formatitko.py", line 64, in main
    HTMLGenerator(sys.stdout, katexClient, imageProcessor).generate(doc2)
  File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/html_generator.py", line 35, in generate
    super().generate(e)
  File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/output_generator.py", line 121, in generate
    self.TYPE_DICT_MISC[type(e)](e)
  File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/output_generator.py", line 435, in generate_Doc
    self.generate_simple_tag(e)
  File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/output_generator.py", line 206, in generate_simple_tag
    self.generate_simple_block_tag(tag, content, attributes)
  File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/output_generator.py", line 216, in generate_simple_block_tag
    self.generate(content)
  File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/html_generator.py", line 35, in generate
    super().generate(e)
  File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/output_generator.py", line 110, in generate
    self.generate_ListContainer(e)
  File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/output_generator.py", line 235, in generate_ListContainer
    self.generate(child)
  File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/html_generator.py", line 35, in generate
    super().generate(e)
  File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/output_generator.py", line 114, in generate
    self.generate_Block(e)
  File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/output_generator.py", line 368, in generate_Block
    self.TYPE_DICT_BLOCK[type(e)](e)
  File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/html_generator.py", line 205, in generate_BlockGroup
    self.generate_Group(e)
  File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/html_generator.py", line 209, in generate_Group
    self.generate_simple_tag(e, attributes=self.common_attributes(e) | {"lang":self.context.get_metadata("lang")})
  File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/output_generator.py", line 206, in generate_simple_tag
    self.generate_simple_block_tag(tag, content, attributes)
  File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/output_generator.py", line 214, in generate_simple_block_tag
    self.writeln(self.start_tag(tag, attributes))
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/html_generator.py", line 49, in start_tag
    words.append(f"{key}=\"{self.escape_special_chars(value)}\"")
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/html_generator.py", line 38, in escape_special_chars
    text = text.replace("&", "&amp;")
           ^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'replace'

Zde get metadata vrátí None:

		self.generate_simple_tag(e, attributes=self.common_attributes(e) | {"lang":self.context.get_metadata("lang")})
``` <main> Traceback (most recent call last): File "/home/jiri/mff/bakararka/zapoctak-past/venv/bin/formatitko", line 8, in <module> sys.exit(main()) ^^^^^^ File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/formatitko.py", line 64, in main HTMLGenerator(sys.stdout, katexClient, imageProcessor).generate(doc2) File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/html_generator.py", line 35, in generate super().generate(e) File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/output_generator.py", line 121, in generate self.TYPE_DICT_MISC[type(e)](e) File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/output_generator.py", line 435, in generate_Doc self.generate_simple_tag(e) File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/output_generator.py", line 206, in generate_simple_tag self.generate_simple_block_tag(tag, content, attributes) File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/output_generator.py", line 216, in generate_simple_block_tag self.generate(content) File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/html_generator.py", line 35, in generate super().generate(e) File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/output_generator.py", line 110, in generate self.generate_ListContainer(e) File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/output_generator.py", line 235, in generate_ListContainer self.generate(child) File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/html_generator.py", line 35, in generate super().generate(e) File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/output_generator.py", line 114, in generate self.generate_Block(e) File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/output_generator.py", line 368, in generate_Block self.TYPE_DICT_BLOCK[type(e)](e) File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/html_generator.py", line 205, in generate_BlockGroup self.generate_Group(e) File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/html_generator.py", line 209, in generate_Group self.generate_simple_tag(e, attributes=self.common_attributes(e) | {"lang":self.context.get_metadata("lang")}) File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/output_generator.py", line 206, in generate_simple_tag self.generate_simple_block_tag(tag, content, attributes) File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/output_generator.py", line 214, in generate_simple_block_tag self.writeln(self.start_tag(tag, attributes)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/html_generator.py", line 49, in start_tag words.append(f"{key}=\"{self.escape_special_chars(value)}\"") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/jiri/mff/bakararka/zapoctak-past/formatitko/src/formatitko/html_generator.py", line 38, in escape_special_chars text = text.replace("&", "&amp;") ^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'replace' ``` Zde get metadata vrátí `None`: ``` self.generate_simple_tag(e, attributes=self.common_attributes(e) | {"lang":self.context.get_metadata("lang")}) ```
Poster
Owner

Funguje.

Funguje.
jirikalvoda closed this issue 1 year ago
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.