-
-
Notifications
You must be signed in to change notification settings - Fork 969
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
</> terminating tag [Question/Bug] #1966
Comments
Interesting This is a compiler's bug. |
Yes, just the normal
And the custom tag turns that into:
|
@BuGlessRB this doesn't works because is not ending with a valid closing tag, see the Guide. With regexes, there's no way to detect expressions ending the html part, so I take your hack to give support for these cases in the compiler with a minor change: this will be The addition of the BuGless-hack (may I?) is in the "dev" branch and will be release in v2.5.4 of the riot-compiler, and docummented in the section Untagged HTML content of the guide, with a brief example. |
The nick is there for a reason, so BuGless-hack is fine :-). The |
nope, you can use multiple script tags + untagged js: <my-tag>
var title = 'foo'
var x = { title }
<script type="typescript">
const y :string = "bar"
</script>
</my-tag> |
Hmmm, well, that does not strike me as a feature (putting it politely). |
agree, but is in the specs before me :) |
Well, it shouldn't have been in those specs in the first place (if you ask me). So I vote to eliminate that part of the specs for 3.0.0. I would even go as far as making |
It was propesed by some people yet, maybe we can do something about this for v3. @riot/core-maintainers what do you think? I'm not sure about such change because you can put |
Ah, due to the fact that script tags cannot be nested. Nonetheless, I'd say, then make that an exception: i.e. only support missing |
mmm... I'll will think about it. |
Besides solving some parsing issues, I expect for it to speed up the parsing process as well. Incidentally, I just tried the dev branch from github, but it does not seem to contain the fix just yet. Am I missing something? |
@aMarCruz @BuGlessRB I would not force our users using scripts to handle their tags logic. Riot is build with the idea of keeping things simple, it's not opinionated so it will give you the freedom to write your code however you want. I wouldn't care that much about such edge cases and protecting users from themselves |
Well, the only things I can say on that are that:
|
@aMarCruz honestly speaking, I like the idea of mandatory theCodeOutsideTagIsAllowedInRiot()
<my-tag>
...
</my-tag> We might need a kind of strict mode but it needs more discussions from many aspects. At least, we shouldn't start the discussion from this issue, I think. Maybe, Riot v4 or later? |
Why would using riot tags in things as With regard to mandatory |
@cognitom mandatory Maybe riot v4 can do something about this... |
@GianlucaGuarini agreed, thanks. @BuGlessRB sorry, the update is in the dev branch of the riot-compiler. git clone https://github.com/riot/compiler && cd compiler
git checkout dev && npm i && make
sudo npm link
cd ../<your riot repo>
npm un riot-compiler && npm link riot-compiler
make riot |
I created a tag to make the page-title auto-updating, and ended up with this:
It turns out , that in order to get this working, I was forced to terminate the HTML part of the tag using
</>
, just before the<script>
. The questions would be:<script>
to autoterminate the HTML part instead?</>
a supported way to accomplish this?Using
<span>...</span>
to encapsulate the HTML is not an option, since browsers do not tolerate any nested HTML directives in the<title>
tag.The text was updated successfully, but these errors were encountered: