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

Make inline comments configurable #14

Closed
abstrctn opened this issue Apr 23, 2015 · 4 comments
Closed

Make inline comments configurable #14

abstrctn opened this issue Apr 23, 2015 · 4 comments

Comments

@abstrctn
Copy link
Contributor

Copying over from @aplayford in newsdev/archieml-js#8:

Right now, anything enclosed in [brackets] is interpreted as a comment. But many newspapers use brackets in news copy to indicate words that were added by the writer to a quote for clarity.

Could the trigger be configurable? A multi-character combination would be especially helpful (so we can find something unlikely to clash and that doesn't interfere with our templating system).

Adam
Tampa Bay Times

@abstrctn
Copy link
Contributor Author

This also seems relevant to newsdev/archieml-js#5, as well as an issue I came across recently in writing cross-parser tests: how to include JSON as part of an AML document. Because all text inside single brackets is stripped out, that makes it difficult to store JSON that contains an array as a value:

json: {array: [1, 2, 3]}

Will get converted to {"json": "{array: }"}, which is pretty useless.

The most simple solution would be to have a setting that toggles this on and off. A more complex solution for parsers would be making it adjustable.

@aplayford
Copy link

Toggling off would solve our problem! For this type of content we really don't need inline comments (and if we really did we do it with our templating language)...

Adam
Tampa Bay Times

@abstrctn
Copy link
Contributor Author

I took a stab at implementing this in archieml-js at newsdev/archieml-js#11. Want to try it out @aplayford and see whether that would work for you?

I'm inclined to go the toggle route over configuring the comment syntax, since inline comments do not alter the resulting document structure, making it trivial to pass values through a custom regex as needed post-parsing.

@aplayford
Copy link

This should work perfectly but we'll test it and let you know. Thank you!

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

2 participants