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

Insert listItem on rule #636

Open
javisperez opened this issue Jan 3, 2019 · 3 comments
Open

Insert listItem on rule #636

javisperez opened this issue Jan 3, 2019 · 3 comments
Assignees

Comments

@javisperez
Copy link

Hi!

Sorry for opening an issue for a question but couldnt find any issue related.

I'm trying to insert a listItem from a rule, the idea is that I'm creating a custom markdown rule that should insert a custom list (LI) element but seems like I cant insert a <li> element without a parent <ul> (which makes sense).

This is a sample of what im trying to achieve:

{
      type: 'lang',
      regex: /(^|\n)(listitem)\n/g,
      replace() {
        return `<li>List Item</li>\n`;
      },
}

Any idea of how can I achieve this?

@javisperez
Copy link
Author

Hello, any help?

@tivie tivie self-assigned this Jan 13, 2019
@tivie
Copy link
Member

tivie commented Jan 13, 2019

Can you give an input and expected output of what you're trying to achieve?

@javisperez
Copy link
Author

Sure, the idea is basically this:
Input

- !! I am here
- !! Same here

Output

<ul class="important-list">
    <li>I am here</li>
    <li>Same here</li>
</ul>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants