sq10
Forum Replies Created
-
Forum: Plugins
In reply to: [Google+ Crossposting] Trimming titlesWorks wonderfully. Thanks for the quick fix!
Forum: Plugins
In reply to: [Google+ Crossposting] Trimming titlesSweet, I’ll be sure to try it out.
Thanks!Forum: Plugins
In reply to: [Google+ Crossposting] Trimming titlesI just created a page for testing.
ID: 106424804349715755721Forum: Plugins
In reply to: [Google+ Crossposting] Trimming titlesBasically, I think the alternate title trimming should be like this:
On Google+, the people that want the plugin to use the alternate trimming scheme will post like so:
title of post
content of post…and the plugin will determine the title by fetching the bold sentence. The bold sentence has to be the very first sentence of the post for it to be determined as the title, and if there is no bold sentence/phrase/whatever, then it uses the fallback title trimming technique.
So it’ll be kinda like this (if it were in Javascript, since I know little PHP)
//Assuming the post is an HTML string function get_title(post){ //whatever the original function does to get the post title } function get_title_alternate(post){ var result = (new RegExp(/^<b>([\s\S]+?)<\/b>/gm)).exec(post); //If the regex didn't match anything, use the fallback. if (!result) return get_title(post); //Other than that, return the resulting title (capture group 1). return result[1]; }
IMO it shouldn’t be too hard to implement.
Forum: Plugins
In reply to: [Google+ Crossposting] Trimming titlesWe’re talking about trimming titles, not changing the way everything is formatted.
There’s minimal testing in this — the “fallback” title trimming system will fetch the title like the plugin usually does, and all it does is trim the title just a bit more to fit with steve’s specs.
It’s essentially like this (hope you don’t mind the pseudocode)
function trim_title_original() title = get_title() set_title(title) function trim_title_alternate() title = get_title() title = trim_title(title) set_title(title)
Forum: Plugins
In reply to: [Google+ Crossposting] Trimming titlesThen why not add it as a formatting option, so in case the current way of trimming titles doesn’t work, people can use stevedowe’s workaround as a fallback?
Forum: Plugins
In reply to: [Google+ Crossposting] Trimming titlesI’ll have to figure out how Google+ does titles then, since where I read, it said that Google+ sets the title to be the first line’s content in bold, but that’s evidently not the case.