Skip to content

Multiline entry results in multiple entries #31

@Mulugruntz

Description

@Mulugruntz

Let's say I have the following changelog:

# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- Changed `f()` and `g()` into `h(b:bool)`.

  **The change is NOT backward compatible!!** 
  
  Please replace `.f()` -> `.h()`
  And replace `.g()` -> `.h(b=True)`

  Reason: There is a bug in `somelib` ...

  More: https://bugs.python.org/issueXXXXX
- Release note 2.

## [1.0.0] - 2017-04-10
### Deprecated
- Known issue 1 (1.0.0)
- Known issue 2 (1.0.0)

[Unreleased]: https://github.test_url/test_project/compare/v1.0.0...HEAD
[1.0.0]: https://github.test_url/test_project/releases/tag/v1.0.0

Rendered as so:

Details

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.

Unreleased

Changed

  • Changed f() and g() into h(b:bool).

    The change is NOT backward compatible!!

    Please replace .f() -> .h()
    And replace .g() -> .h(b=True)

    Reason: There is a bug in somelib ...

    More: https://bugs.python.org/issueXXXXX

  • Release note 2.

1.0.0 - 2017-04-10

Deprecated

  • Known issue 1 (1.0.0)
  • Known issue 2 (1.0.0)

If I run:

import keepachangelog
print(keepachangelog.from_dict(keepachangelog.to_dict('CHANGELOG.md', show_unreleased=True)))

This is what I get:

# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- Changed `f()` and `g()` into `h(b:bool)`.
- The change is NOT backward compatible!!**
- Please replace `.f()` -> `.h()`
- And replace `.g()` -> `.h(b=True)`
- Reason: There is a bug in `somelib` ...
- More: https://bugs.python.org/issueXXXXX
- Release note 2.

## [1.0.0] - 2017-04-10
### Deprecated
- Known issue 1 (1.0.0)
- Known issue 2 (1.0.0)

[Unreleased]: https://github.test_url/test_project/compare/v1.0.0...HEAD
[1.0.0]: https://github.test_url/test_project/releases/tag/v1.0.0

Rendered as:

Details

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.

Unreleased

Changed

  • Changed f() and g() into h(b:bool).
  • The change is NOT backward compatible!!**
  • Please replace .f() -> .h()
  • And replace .g() -> .h(b=True)
  • Reason: There is a bug in somelib ...
  • More: https://bugs.python.org/issueXXXXX
  • Release note 2.

1.0.0 - 2017-04-10

Deprecated

  • Known issue 1 (1.0.0)
  • Known issue 2 (1.0.0)

As we can see, each line is managed as a new note.

import keepachangelog, pprint
pprint.pprint(keepachangelog.to_dict('CHANGELOG.md', show_unreleased=True)['unreleased']['changed'])
['Changed `f()` and `g()` into `h(b:bool)`.',
 'The change is NOT backward compatible!!**',
 'Please replace `.f()` -> `.h()`',
 'And replace `.g()` -> `.h(b=True)`',
 'Reason: There is a bug in `somelib` ...',
 'More: https://bugs.python.org/issueXXXXX',
 'Release note 2.']

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions