You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To help users debug their BBCode markup and to generally enhance the level of error feedback, I've been validating the params and content in the openTag function of my tag specifications.
Here's an example of what I've got working:
Did you ever put any thought into this kind of feature?
Obviously that's nasty and this certainly isn't a solution proposal, but it's an example of the kind of validation that would be nice to do.
As for a real solution that might be trivial, one idea off the top of my head would be to be to support an optional property on tag specs:
openTag: ...,
closeTag: ...,
// Returns String (err message) upon validation failure, else returns falsey
errorCheck: function(params, content) {
if (!params) return 'Missing color parameter';
}
Any ideas? Either way, I'll see what kind of abstraction I end up with once I start refactoring my mess.
Also, I know this is an old project of yours, and it's possible that BBCode and this repo aren't at the forefront of your mind these days like it was back when you wrote it.
The text was updated successfully, but these errors were encountered:
I like the idea for an optional property on the tag spec to do the validating/error checking.
You're correct that it's been a while since I've taken much of a dive into this project, but I'm happy to merge in any changes you do if they look like they'll make the project better.
To help users debug their BBCode markup and to generally enhance the level of error feedback, I've been validating the
params
andcontent
in theopenTag
function of my tag specifications.Here's an example of what I've got working:
Did you ever put any thought into this kind of feature?
I haven't studied your code too much yet, so until I figure out how it works, I threw some global state at the problem and wrote some regretful code: https://gist.github.com/danneu/f5b8b58b87b828b708bb
Obviously that's nasty and this certainly isn't a solution proposal, but it's an example of the kind of validation that would be nice to do.
As for a real solution that might be trivial, one idea off the top of my head would be to be to support an optional property on tag specs:
Any ideas? Either way, I'll see what kind of abstraction I end up with once I start refactoring my mess.
Also, I know this is an old project of yours, and it's possible that BBCode and this repo aren't at the forefront of your mind these days like it was back when you wrote it.
The text was updated successfully, but these errors were encountered: