Closed alerque closed 7 years ago
Hi Caleb, cool idea! I'm currently having a look into how I could implement that nicely. Getting stuck on regexes currently though because I am not sure if it would be better to implement it to cut out the regex match or to keep it.
I am actually not even sure how to write a regex to match only to the first part. Would I use groups and only take the first group?
Example:
Match and strip extra strings from titles · Issue #25 · seeba8/yet-another-pinboard-extension · GitHub | https://github.com/
I could keep the first group of ^(.*)\s\|.*$
.
Alternatively, the regex could describe the part to be ignored:
I could use \s\|.*$
to regex for the part I want to ignore.
What would you suggest?
Edit: Ah, learning something about regex today...
.*(?=\s\|.*$)
seems to do what I want.
I would recommend stripping the regex match as the simplest approach. Keeping the first group would certainly be more flexible (allowing stripping of things at both the beginning and end of a title) but might be more complicated that some people are interested in. Then again as an advanced user preference maybe that's fine. Just default the regex to ^(.*)$
and keep the first group match.
Hi @alerque, if you want, please check out the attached version. I have not updated it yet in case there are any bugs, but you can try it out already, maybe you catch something in your configuration.
To install, open about:debugging
on firefox / check debug extensions on chrome, and install the unzipped extension by selecting one of the files inside the root folder.
regex-added.zip
I am kind of confident it works, but of course I'm happy about feedback!
This seems to be released in the addons site version, so that's what I'm using. The expression seems to work in the titles that show up in the settings page to preview how the match works. but it doesn't seem to have any effect for me in the popup when pinning a new page. Is there something I'm missing?
No, you missed nothing. Oversight on my part, I added it to all the "Read later" options (context menu, button in the popup, etc). Pushed out the change on AMO as well, should be downloadable as soon as the automatic review process runs through (usually 10 minutes). Rightclick on the addon in about:addons to manually check for updates.
If you have any other ideas what the extension could benefit from, please don't hesitate to post a bug here :)
Works for me now. I think we can call this closed, and thanks for the feature!
A number of extensions (in my case titleUrl) are available that add strings to the tile of tabs — often so that they can be securely matched by password-manager autofill functions.
This has the unwanted side effect of creating noise in my bookmarks. It would be great if this extension could apply a customable regex to all titles. Because titleUrl and others allow a custom separator character, it would be trivial to write an expression that removes everything after the separator.