hagenburger / pimd

PIMD – Processing Instructions for Markdown
https://hagenburger.github.io/pimd-docs/
MIT License
20 stars 5 forks source link

Trailing processing instructions should be related to <img>/<a> #1

Open hagenburger opened 6 years ago

hagenburger commented 6 years ago

Current situation

Usually processing instructions have defined the paragraph as their element:

Lorem <?pi?> ipsum

pi.element refers to the <p> which will contain Lorem ipsum.

Proposed change

When a processing instruction is following a link/image, it would be useful if it’s pi.element refers to the <a>/<img>:

Lorem [ipsum](ipsum.html)<?pi?> dolor
Lorem ![ipsum](ipsum.jpg)<?pi?> dolor

Example usage

This way it would be easy to access attributes like adding an ID, classes, or attributes:

Lorem ![ipsum](ipsum.jpg)<?: #my-image ?> dolor
Lorem ![ipsum](ipsum.jpg)<?: .big-image ?> dolor
Lorem ![ipsum](ipsum.jpg)<?: [width=100%] ?> dolor
violetadev commented 6 years ago

#1 Trailing processing instructions should be related to /