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

markdown in irc nickname #327

Open
Helianthella opened this issue Oct 17, 2017 · 5 comments
Open

markdown in irc nickname #327

Helianthella opened this issue Oct 17, 2017 · 5 comments

Comments

@Helianthella
Copy link

If a user on IRC is named _nick_ it will be sent to discord as-is and so appear as nick but italicized instead of appearing as _nick_ non-italicized. To avoid this, discord-irc should prepend any markdown in nicknames with backslashes so _nick_ would be sent as \_nick\_ and show properly on discord

@Throne3d Throne3d added the bug label Oct 19, 2017
@unnes
Copy link

unnes commented Jan 5, 2018

I'm trying to block an IRC user with the name "|N_X|4_cG_4iH4xW\Nkx1z2GXL0u"

Trying to escape the underscores and backslashes results in the following error:

/usr/lib/node_modules/discord-irc/dist/cli.js:48
throw new _errors.ConfigurationError('The configuration file contains invalid JSON');
^

ConfigurationError: The configuration file contains invalid JSON
at readJSONConfig (/usr/lib/node_modules/discord-irc/dist/cli.js:48:13)
at Object.run [as default] (/usr/lib/node_modules/discord-irc/dist/cli.js:62:98)
at Object. (/usr/lib/node_modules/discord-irc/dist/index.js:23:27)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Function.Module.runMain (module.js:684:10)
at startup (bootstrap_node.js:187:16)

Any suggestions?

@Helianthella
Copy link
Author

Helianthella commented Jan 5, 2018

@unnes try HTML entities, or just wrap the whole thing in an inline code block

@Throne3d
Copy link
Collaborator

Throne3d commented Jan 5, 2018

You shouldn't need to escape underscores, just backslashes and quotes. If you're getting an "invalid JSON" error, you may have done it wrong (perhaps JSON doesn't like you escaping underscores). This also seems mostly unrelated to the main issue here, so I'd suggest putting this into a new issue if you still have trouble.

@mekolat I don't think that helps solve the problem? How would you wrap a bit of JSON in an inline code block, and why would HTML entities be relevant – it's JSON?

@Helianthella
Copy link
Author

I meant on Discord, not in the config.json file; I thought @unnes was trying to escape the name on Discord, which is what the issue (#237) is about..

@Throne3d
Copy link
Collaborator

Throne3d commented Jan 5, 2018

Ah, right – no, I think it's an unrelated issue which was put here erroneously.

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

No branches or pull requests

3 participants