Auto-generate preconfigured class attributes #355
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
From my understanding it is currently impossible to let the Markdown library generate class attributes in the html output. While it would be possible to include those after the text has been generated via regex replace, it is much easier to configure the Markdown object beforehand, e.g. if you want all images in the output to have the "control-img" class.
I dont know if this is rather a thing I would only need for my specific use-case or if there is more interest in this, I created a pull-request for it.
In my use-case, I generate forum article html content from Markdown source files, inside of the general php generated html content. This exposes me to the following problem:
If I include images in the Markdown, there is currently no possibility to control their width and height, although there is a pull request open for this exact issue. I believe allowing class attributes to be added to generated html tags to use them in css styling purposes would make things quite a bit easier.
I currently did only include attribute generation for html tags
a
andimg
, however if accepted I can of course add support for the other tags generated as well.