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

Fallback values used in a formatter without spaces do not work as expected #2

Closed
ezekg opened this issue Apr 6, 2016 · 1 comment
Closed
Labels

Comments

@ezekg
Copy link
Owner

ezekg commented Apr 6, 2016

For example,

cat /etc/apache2/sites-available/*.conf | xo '/\*:443.*?ServerName\s(www\.)?([-.0-9A-Za-z]+)/$1:?www.$2/mis'

stops on the . after www, so sites that contain www. in the name are output as www..site-name.com. To fix this, we should introduce optionally wrapping fallback values within parenthesis, as well as support for escaping those parenthesis in the case that they are actually needed in the formatter.

@ezekg ezekg added the bug label Apr 6, 2016
@ezekg
Copy link
Owner Author

ezekg commented Apr 11, 2016

Oversight on my part. It is working correctly. If we handle allowing periods inside of fallback values then it will mess up formatting sentences, which is what xo is often used for, when the value needs to end with a period. Corrected command would be:

cat /etc/apache2/sites-available/*.conf | xo '/\*:443.*?ServerName\s(www)?\.?([-.0-9A-Za-z]+)/$1?:www.$2/mis'

@ezekg ezekg closed this as completed Apr 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant