Closed ralyodio closed 10 years ago
Have you tried to prefix or suffix each markdown with a different string like on the demo page ?
It may fails cause the directive can't make the difference with the two
Bump, have you still the issue ?
I got it working, but I think you should re-consider how you construct your CSS. You should give each element a common class like .md-editor
and .md-preview
...and then use the suffix to add an additional class you can associate the preview with the editor with.
Yeah you right on that point, will change it as soon I find something correct.
So for you, I should use a general class for css purposes and another one specific to distinguish every editor, so still with a prefix
and suffix
system ? What about an id
based ? I generally avoid this, but if it's the best way, why not.
Closing this issue
i don't know why you need both prefix AND suffix. Seems like you could just use 'version' instead.
I would avoid ids, simply because you have 2 or 3 elements to group together. Only one unique id per page should be used. Also I recommend you group the entire thing in a div, in which case id is ok.
<div id="md-1" class="md-instance">
<textarea class="md-editor"></textarea>
<div class="md-preview"></div>
</div>
Then you CSS could be this (sass/less):
.md-instance {
.md-editor {
}
.md-preview {
}
}
Opps yeah was tired, forgot that I have three elements.
The main reason the directive does not wrap all the three element is to allow the user to have a very specific markup, like bootstrap or other, and to allow the elements to not be necessarily next to each other. Really want to keep it that way.
I'm getting some issues trying to use editor twice on same page.