Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example with after function #7

Open
jezozwierzak opened this issue Sep 26, 2013 · 3 comments
Open

Example with after function #7

jezozwierzak opened this issue Sep 26, 2013 · 3 comments

Comments

@jezozwierzak
Copy link

Could I ask for an example with "after" function?

@mrpeo
Copy link

mrpeo commented Sep 17, 2014

Cannot replace ! char, this char caused error in url of browser.

@DavidTheSimon
Copy link

@mrpeo Your problem can be resolved by adding the before method callback, like so:

before: function(text) {
    return text
        .split("'").join('')
        .split('!').join('')
        .split('(').join('')
        .split(')').join('');
}

This is a temporary fix until the author fixes the issues. Although it's been over 2 years since the last commit so I'm doubtful of that,

@kuntur-studio
Copy link

kuntur-studio commented Jul 20, 2017

@mrpeo That problem can be resolved by mapping the problematic character to the separator character like this:

map: {
'!': '-'
}

That way the character will simply act as a separator and the plugin will flow normally without the needing of any callback.

If you map any character to an empty string then the mapping will have no effect at all, because the line 49:
if ( chars[text.charAt(i)] ) ===>falsy value<===

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants