hash_bookmark doesn't work with non-ASCII headlines and blank headlines
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- frontend
Research direction
Start with the slug construction in src/js/core/TimelineConfig.js and ensureUniqueKey in src/js/core/Util.js. Reproduce hash bookmarks after reloads using non-ASCII and blank headlines, then determine stable identifier behavior for both cases. Done means slide IDs remain consistent across page loads so hash bookmarks work, or the supported limitation is documented.
Written by the indexing model from the issue text.
Description
We got a support request from the creator of a Chinese-language timeline who wanted to use hash bookmarks.
They were failing because the slide IDs were different every time the page is loaded.
When a TimelineConfig object is instantiated, populated, it attempts to ensure that all slides have unique identifiers, mostly to support the hash bookmark feature. If the configuration is JSON based, the IDs can be specified using
the unique_id property of a slide object, but for most people using Spreadsheet configuration, there is no direct control over the IDs.
If no ID is specified, timeline tries to construct one from the headline, but the slugify function filters out non-ASCII characters, leaving an empty "slug" for Chinese-language headlines (among others).
That function calls out to another, ensureUniqueKey which is designed to do things like add numbers if the same headline is used more than once. If this function gets a blank ID, it generates a random six-character string. Since these have no relationship to the content of the slide, they will almost never come up the same way twice.
The tl;dr is that for timelines that have slides with non-ascii headlines or blank headlines, the hash_bookmark function will not work, unless the timelines are configured using JSON with explicit IDs specified.
Probably we need to come up with some kind of hashing function, which could be applied to non-ascii strings, but there would still be an issue with slides which have no headline. I'd probably be OK with saying that people who want to use hash_bookmark and have slides with blank headlines should use the JSON format, since it seems like quite an edge case.
- Dominant language
- JavaScript
- Stars
- 3.2k
- Forks
- 644
- Avg merge
- 3m
- Merged PRs (30d)
- 2
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NUKnightLab/TimelineJS3
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
NUKnightLab/TimelineJS3#797 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
NUKnightLab/TimelineJS3#617 ·
-
Bug CSS
Difficulty 1/5 Under an hour Newbie friendliness 62/100
NUKnightLab/TimelineJS3#602 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
NUKnightLab/TimelineJS3#904 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
NUKnightLab/TimelineJS3#902 · 2 comments ·
All issues in NUKnightLab/TimelineJS3
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
typesense/typesense-js#376 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
FuRongJun-1999/dsh-memory#56 ·
Maintainers usually reply within 1 day
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
pgadmin-org/pgadmin4#10503 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
521xueweihan/HelloGitHub#3856 ·
-
needs-ac
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Ikalus1988/MisakaNet#2845 ·
Maintainers usually reply within 1 day