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
Closed

News sections not rendered if version is in parentheses #980

jayhesselberth opened this issue Feb 28, 2019 · 5 comments · Fixed by #1036
Labels
bug an unexpected problem or unintended behavior news 📰 wip work in progress
Milestone

Comments

@jayhesselberth
Copy link
Collaborator

jayhesselberth 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
Copy link
Collaborator Author

This regex fails to capture parenthetical versions:

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

@jayhesselberth
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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

@kwathen
Copy link

kwathen 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 an unexpected problem or unintended behavior label May 17, 2019
@jayhesselberth
Copy link
Collaborator Author

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 work in progress label May 20, 2019
hadley added a commit that referenced this issue May 20, 2019
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 pushed a commit that referenced this issue Jun 23, 2019
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
Labels
bug an unexpected problem or unintended behavior news 📰 wip work in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants