Skip to content

Show entry titles as text in the pager and the big calendar - #272

Open
snoopdave wants to merge 1 commit into
roller-6.1.xfrom
entry-title-plain-text
Open

snoopdave wants to merge 1 commit into
roller-6.1.xfrom
entry-title-plain-text

Conversation

@snoopdave

Copy link
Copy Markdown
Contributor

The next/previous links on a permalink page and the big calendar (#showWeblogEntryCalendarBig) printed entry titles from the POJO, not the wrapper, and handled markup and entities inconsistently.

  • New Utilities.plainTextExcerpt: remove markup, decode entities, cut at a word boundary, then HTML-encode. The pager (15–20 characters) and the calendar (20) use it.
  • A title saved by the editor with & no longer becomes &, and markup in a title no longer reaches the page as markup.
  • Titles posted through AtomPub and XML-RPC are stored as before.

Tests: UtilitiesTest.testPlainTextExcerpt, and WeblogEntriesPermalinkPagerTitleTest, which builds real entries and checks the next/previous names. The pager test fails on roller-6.1.x and passes here. mvn -pl app test: 500 tests, 0 failures. No test covers the calendar change; it uses the same helper, but a look at an archive page with the big calendar would confirm it.

Once this is merged, the same change goes to master for 7.0.0.

The next/previous links on a permalink page and the titles in the big
calendar now go through a new Utilities.plainTextExcerpt: markup removed,
entities decoded, cut at a word boundary, then HTML-encoded. Titles saved
with entities are no longer encoded twice.

@mraible mraible left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. plainTextExcerpt decodes and cuts the text before encoding it, so a cut can't land inside an entity and markup can't reach the page. Null and blank titles are handled. No other pager or calendar code prints raw titles. Trivial nit: the new Utilities import in BigWeblogCalendarModel sits between two pojos imports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants