Skip to content

Issues numbers added after rst preformatted blocks breaks rendering #614

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
SmileyChris opened this issue Jun 13, 2024 · 6 comments · Fixed by #624
Closed

Issues numbers added after rst preformatted blocks breaks rendering #614

SmileyChris opened this issue Jun 13, 2024 · 6 comments · Fixed by #624

Comments

@SmileyChris
Copy link
Contributor

From #608:

An interesting aside: without some text after the pre-formatted block, it breaks the rendering of the issue number towncrier adds when building because it's considered part of the block.

For example, a file newsfragments/608.feature.rst:

Something was fixed. Now this is a thing::

    def code_block():
        ...

will produce:

- Something was fixed. Now this is a thing::

      def code_block():
          ... (`#608 <https://github.com/twisted/towncrier/issues/608>`_)

Which renders as:
image

The solution is probably to Prepend \n\n to the issue number in this case (a single newline will result in (WARNING/2) Literal block ends without a blank line; unexpected unindent.)

Maybe it's easier always putting the issue number in a separate paragraph if any new lines exist in the fragment content?

@adiroiban
Copy link
Member

Are the release notes supposed to contain multi-line / block markup ?

The list item is automatically prefixed to the content and the content of the next fragment is processed by towncrier.


Would it work if the extra newlines are added to the issue_format configuration ?

@jakkdl
Copy link
Contributor

jakkdl commented Jun 26, 2024

I just hit this as well in python-trio/trio#3010
One minimal solution would be to add newlines before appending the issue number if the last line in the newsfragment is indented.

@adiroiban
Copy link
Member

adiroiban commented Jun 26, 2024

I think that content of the news fragment from this PR python-trio/trio#3010 is abusing the release notes format.

The release notes should not be used as documentation and should not include examples.

They can contain links to API documentation or the a separate documentation page that contain example.

The newsfragment are not news articles. They are release notes items.

They are just some notes / mentions about the high-level changes.


I am not saying that this should not be fixed.
It's just that I feel that this is an missuse / abuse of the purpose of a release notes.

I can understand that someone might want to have "rich-format" release notes.

But I think that in that use case we should add something like verbatim = True configuration option.

With that option, towncrier only passes the newsfragment content to Jinja2

@adiroiban
Copy link
Member

As long as it doesn't break backward compatibility and it continues to make simple things, simple, any fix for this issue should be ok.

@jakkdl
Copy link
Contributor

jakkdl commented Jun 27, 2024

Yeah I'm not gonna defend that changelog entry as being a pinnacle of greatness, and is not unlikely I'll change it before it gets merged. But unless towncrier wants to explicitly be opinionated about multi-line entries I agree that we can introduce a small & simple fix that quietly gets out of the way of breaking rendering.

@adiroiban
Copy link
Member

But unless towncrier wants to explicitly be opinionated about multi-line entries I agree that we can introduce a small & simple fix that quietly gets out of the way of breaking rendering.

I don't want towncrier to be opinionated.
It's a tool designed to help developers manage the release notes regardless of the content of the release notes.

Happy to review and merge a fix for this.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants