diff --git a/src/django_docutils/lib/metadata/extract.py b/src/django_docutils/lib/metadata/extract.py index 40dce804..08174cc6 100644 --- a/src/django_docutils/lib/metadata/extract.py +++ b/src/django_docutils/lib/metadata/extract.py @@ -54,6 +54,7 @@ def extract_metadata(document: nodes.document) -> dict[str, str]: continue if element.tagname == "field": # custom fields (e.g. summary) + assert len(element.children) == 2 name_elem, body_elem = element.children assert isinstance(name_elem, (nodes.Text, nodes.Element)) assert isinstance(body_elem, (nodes.Text, nodes.Element)) diff --git a/src/django_docutils/lib/publisher.py b/src/django_docutils/lib/publisher.py index 6ab89226..bee1dca9 100644 --- a/src/django_docutils/lib/publisher.py +++ b/src/django_docutils/lib/publisher.py @@ -33,7 +33,7 @@ def publish_parts_from_doctree( enable_exit_status: bool = False, ) -> dict[str, str]: """Render docutils doctree into docutils parts.""" - reader = Reader(parser_name="null") + reader = Reader(parser_name="null") # type:ignore pub = Publisher( reader, None, @@ -45,9 +45,9 @@ def publish_parts_from_doctree( if not writer and writer_name: pub.set_writer(writer_name) pub.process_programmatic_settings( - settings_spec, # type:ignore + settings_spec, settings_overrides, - config_section, # type:ignore + config_section, ) pub.set_destination(None, destination_path) pub.publish(enable_exit_status=enable_exit_status) @@ -121,7 +121,7 @@ def publish_doctree( register_django_docutils_directives() register_django_docutils_roles() - return docutils_publish_doctree( + return docutils_publish_doctree( # type:ignore source=force_bytes(source), settings_overrides=settings_overrides, ) diff --git a/src/django_docutils/lib/roles/common.py b/src/django_docutils/lib/roles/common.py index 8822a7b8..a9572359 100644 --- a/src/django_docutils/lib/roles/common.py +++ b/src/django_docutils/lib/roles/common.py @@ -130,7 +130,7 @@ def url_handler(target): if not has_explicit_title: title = utils.unescape(remote_title) - sn = innernodeclass(title, title) + sn = innernodeclass(title) rn = nodes.reference("", "", internal=True, refuri=url, classes=[name]) rn += sn return [rn], []