Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter sq10

    (@sq10)

    Works wonderfully. Thanks for the quick fix!

    Thread Starter sq10

    (@sq10)

    Sweet, I’ll be sure to try it out.
    Thanks!

    Thread Starter sq10

    (@sq10)

    I just created a page for testing.
    ID: 106424804349715755721

    Thread Starter sq10

    (@sq10)

    Basically, 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.

    Thread Starter sq10

    (@sq10)

    We’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)

    Thread Starter sq10

    (@sq10)

    Then 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?

    Thread Starter sq10

    (@sq10)

    I’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.

Viewing 7 replies - 1 through 7 (of 7 total)