Github user riknoll commented on a diff in the pull request:

    https://github.com/apache/cordova-docs/pull/532#discussion_r54825004
  
    --- Diff: www/static/js/docs.js ---
    @@ -17,19 +17,30 @@
     
     $(document).ready(function () {
     
    -    function slugify(text) {
    +    function slugifyLikeGitHub(originalText) {
    +
    +        var text = originalText;
    +
    +        // convert to lowercase
             text = text.toLowerCase();
     
    -        // replace unaccepted characters with spaces
    +        // replace whitespace characters with dashes
    +        text = text.replace(/\s/g, '-');
    +
    +        // remove dashes at the start and end if they weren't there since 
the start
    --- End diff --
    
    If they weren't there from the start? What about these two cases:
    ```
    "  -hello" => "--hello"
    "   hello" => "hello"
    ```
    Is that right? Should the first example work out that way with the extra 
dash? Seems like `trim()` should maybe get called before the first replace


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to