Skip to content

Commit

Permalink
Don't normalize labels inside the Reference constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
colinodell committed May 25, 2020
1 parent e4bf8db commit fb52dd0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -24,6 +24,7 @@ Updates should follow the [Keep a CHANGELOG](https://keepachangelog.com/) princi

- "Moved" the `TableOfContents` class into a new `Node` sub-namespace (with backward-compatibility)
- Reference labels are now generated and stored in lower-case instead of upper-case
- Reference labels are no longer normalized inside the `Reference`, only the `ReferenceMap`

### Fixed

Expand Down
2 changes: 2 additions & 0 deletions docs/1.5/upgrading.md
Expand Up @@ -9,6 +9,8 @@ redirect_from: /upgrading/

## Changes

`Reference` labels are no longer auto-normalized within the `Reference` constructor. Normalization only occurs within the `ReferenceMap`.

## Deprecations

`Reference::normalizeReference()` has been deprecated. Use `TextNormalizer::normalize()` instead.
Expand Down
2 changes: 1 addition & 1 deletion src/Reference/Reference.php
Expand Up @@ -35,7 +35,7 @@ final class Reference implements ReferenceInterface

public function __construct(string $label, string $destination, string $title)
{
$this->label = (new TextNormalizer())->normalize($label);
$this->label = $label;
$this->destination = $destination;
$this->title = $title;
}
Expand Down

0 comments on commit fb52dd0

Please sign in to comment.