Skip to content
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

News sections not rendered if version is in parentheses #980

Closed
jayhesselberth opened this issue Feb 28, 2019 · 5 comments · Fixed by #1036

Comments

@jayhesselberth
Copy link
Collaborator

commented Feb 28, 2019

Rendering NEWS.md with a version in paretheses causes it to be dropped from the rendered page.

If a section begins with this header, it is not present in the rendered page:

# pkgdown (development version)

This renders fine:

# pkgdown 1.3.0.9000

This explains why the development version section is not present on the dev docs

@jayhesselberth

This comment has been minimized.

Copy link
Collaborator Author

commented Feb 28, 2019

This regex fails to capture parenthetical versions:

re <- regexec("^([[:alnum:],\\.]+)\\s+((\\d+[.-]\\d+)(?:[.-]\\d+)*)", titles)

@jayhesselberth

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 5, 2019

Notably this header renders fine:

# pkgdown 1.3.0.9000 (development version)

but makes for a long section title.

jayhesselberth added a commit that referenced this issue Mar 9, 2019
@jayhesselberth

This comment has been minimized.

Copy link
Collaborator Author

commented Mar 23, 2019

The usethis behavior could be updated to add the dev version before the parentheses.

@kwathen

This comment has been minimized.

Copy link

commented Apr 18, 2019

Same thing also happens if you put a v in front of the version,
For example,

pkgdown v1.3.0.9000

Would cause the news to be dropped on the site. The page is there but no content.

@hadley hadley added the bug label May 17, 2019

@jayhesselberth

This comment has been minimized.

Copy link
Collaborator Author

commented May 17, 2019

I think we should accommodate these formats:

# pkgdown 1.3.0

# pkgdown v1.3.0

# pkgdown (development version)

@hadley hadley added this to the pkgdown 1.4 milestone May 17, 2019

@hadley hadley added the wip label May 20, 2019

hadley added a commit that referenced this issue May 20, 2019
Increase flexibility of news title matching
Included a decent amount of refactoring, first to make the regular expression more readable, and then to make news_version return something that was easier to test.

Fixes #980
jayhesselberth added a commit that referenced this issue Jun 23, 2019
Increase flexibility of news title matching (#1036)
Included a decent amount of refactoring, first to make the regular expression more readable, and then to make news_version return something that was easier to test.

Fixes #980
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.