Skip to content
This repository has been archived by the owner on Aug 5, 2021. It is now read-only.

How to parse URL strings? #25

Open
gogo9th opened this issue Feb 4, 2020 · 2 comments
Open

How to parse URL strings? #25

gogo9th opened this issue Feb 4, 2020 · 2 comments

Comments

@gogo9th
Copy link

gogo9th commented Feb 4, 2020

Hi,

I Find Katana parser really useful and thanks for developing this tool for us. I just realized the following is not parsable:

@font-face {
font-weight: 700;
src: url(https://fonts.gstatic.com/s/ytsans/v8/46kqlb3ta3zqoJU2dfPhb0xg0mlY.woff2);
}

Is there any way for us to include styles that start with @?

@gogo9th
Copy link
Author

gogo9th commented Feb 5, 2020

I solved the above issue, but Katana seems to have a bug: it cannot parse the stylesheet below:

My error is:

=================================================================
==4484==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7f7dd54d6023 at pc 0x7f7dd5761733 bp 0x7ffc6b417700 sp 0x7ffc6b416ea8
READ of size 4 at 0x7f7dd54d6023 thread T0
#0 0x7f7dd5761732 (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x79732)
#1 0x7f7dd549477e in katana_string_to_characters src/foundation.c:113
#2 0x7f7dd54bf6e3 in katana_new_number_value src/parser.c:656
#3 0x7f7dd54b6289 in katanaparse src/katana.tab.c:2809
#4 0x7f7dd54bd622 in katana_parse_in src/parser.c:232
#5 0x560bcf5192f6 in dump_stylesheet examples/dump_stylesheet.c:27
#6 0x560bcf51a1bb in main examples/dump_stylesheet.c:124
#7 0x7f7dd50b2b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
#8 0x560bcf519099 in _start (/root/katana-parser/a+0x1099)

@gogo9th
Copy link
Author

gogo9th commented Feb 5, 2020

src/katana.tab.c: 2808
--- number.raw = (KatanaParserString){"to", 4};
+++ number.raw = (KatanaParserString){"to", 2};

But there is still an error for this:

.rp_userbox-container::before {
}

@supports (align: auto) {
}

~

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

No branches or pull requests

1 participant