-
Notifications
You must be signed in to change notification settings - Fork 193
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
feat(nuemark): inline span support, inline and block html nuemark tag support #470
base: master
Are you sure you want to change the base?
Conversation
cdc2c25
to
82a850c
Compare
Are the quotes entirely necessary? hello [.green "*content*"] etc -> hello <span class="green"><em>content</em></span> etc could also be made to work as follows, without requiring quotes hello [.green *content*] etc -> hello <span class="green"><em>content</em></span> etc Which is cleaner and easier to read when there might be use cases where a lot of tagging of content in a particular paragraph is required. |
Yes, you need the quotation marks, though you can also use single ( If you have e.g. an |
91bf786
to
a07dd2d
Compare
Added support for native html tags using nuemark tags Edit: Lone lists will still fail, even with the fix from #472. I might take a look in or after this one. |
c3d3140
to
0857def
Compare
Looks solid. So block tags are still rendered as divs by default? |
The anonymous / unnamed block tags? Yes. |
0857def
to
4e3fd08
Compare
Hi @nobkd I'm not saying it shouldnt be this way, just wanting to know why? e.g. do you mean?
or something else?
I'm sure I've misunderstood so just hoping you can clarify with a simple example, txs, p.s. My reaction to the "" around content, is that it suggests that CONTENT must sometimes look like programmer strings and other times must simply be content. Attributes are uncommon in content, so the default rule in my opinion should be that "content" is never quoted inside markdown, unless you're deliberately disambiguating something, e.g. a span where with attributes (the exception, not the rule), so the
This would be ugly to read inside markdown, but would leave the "normal" case much easier to read, when you simply want to [.red highlight] a particular word in a secondary or other styling that double star (**) would work. Compared to ; This would be ugly to read inside markdown, but would leave the "normal" case much easier to read, when you simply want to [.red "highlight"] a particular word in a secondary or other styling that double star (**) would work. With the quotes, at a quick glance highlight looks like a special attribute, distinct from content, so that's jarring. also, I've seen some implementations use when you simply want to [.red]highlight[/] a particular as an approach? Just mentioning all of these so that we've captured the discussion somewhere and I can understand the rationale. pps; I know these comments are not technically related to this PR, so apologies for that, and it should possibly? be made another issue. I'll create a new issue with a copy of this depending on the reply and answer. (If we agree it's worth discussing further) |
Yes, exactly. Your first example shows how it is with this pr. The non-quoting could work for anonymous / unnamed tags (though there might be some issues with parsing), but for other islands / layout components not so much, as they use mainly attributes. I understand your reasoning, but:
I think a new issue / discussion for this would be better :) Edit:
Not sure, if the same should be for anonymous block tags too, (if they have no children, of course) |
47db7b5
to
e672307
Compare
txs @nobkd Lets see after this gets merged how the usage on bigger projects feels and if it looks like it's worth discussing as a priority I'll create a new issue for discussion and copy notes from here. Txs for the work. Alan |
e672307
to
3bf3d35
Compare
3bf3d35
to
d658399
Compare
d658399
to
61fdf7c
Compare
Thinking about splitting this pr in two. One for unnamed inline spans and another one for named html tags (block and inline). Would probably be easier to review and smaller in scope for both, even though they're tightly related. I'll sleep this night over it, and might open 2 new PRs tomorrow, if I still think this decision is right. Edit: also waiting what will happen with #476 |
Adds basic support for inline spans:
hello [.green "*content*"] etc
->hello <span class="green"><em>content</em></span> etc
hello [.myclass]
->hello <span class="myclass"></span>
Adds support for native html tags with block and inline nuemark tags:
hello [del "content"]
->hello <del>content</del>
(inline)[del "content"]
-><del>content</del>
(empty block with_
attribute)[section.sub]\n hello
-><section class="sub"><p>hello</p></section>
(block)to be done:
span
support, through anonymous tag (hi [.classname]
->hi <span class="classname"></span>
;hi [.c "hi"]
->hi <span class="c">hi</span>
)[i "content"]
-><i>content</i>
) (without manual component)a [.hello world "content"]
->a <span class="hello" world>content</span>
)