Strip leading and trailing whitespace when parsing user scripts/ style
This commit is contained in:
parent
42bf6f5c61
commit
27bba3c318
1 changed files with 2 additions and 0 deletions
|
@ -937,6 +937,7 @@ js_metadata_from_file (const gchar* filename,
|
||||||
while (g_io_channel_read_line (channel, &line, NULL, NULL, NULL)
|
while (g_io_channel_read_line (channel, &line, NULL, NULL, NULL)
|
||||||
== G_IO_STATUS_NORMAL)
|
== G_IO_STATUS_NORMAL)
|
||||||
{
|
{
|
||||||
|
g_strstrip (line);
|
||||||
if (g_str_has_prefix (line, "// ==UserScript=="))
|
if (g_str_has_prefix (line, "// ==UserScript=="))
|
||||||
found_meta = TRUE;
|
found_meta = TRUE;
|
||||||
else if (found_meta)
|
else if (found_meta)
|
||||||
|
@ -1011,6 +1012,7 @@ css_metadata_from_file (const gchar* filename,
|
||||||
while (g_io_channel_read_line (channel, &line, NULL, NULL, NULL)
|
while (g_io_channel_read_line (channel, &line, NULL, NULL, NULL)
|
||||||
== G_IO_STATUS_NORMAL)
|
== G_IO_STATUS_NORMAL)
|
||||||
{
|
{
|
||||||
|
g_strstrip (line);
|
||||||
if (g_str_has_prefix (line, "@-moz-document") || line_has_meta)
|
if (g_str_has_prefix (line, "@-moz-document") || line_has_meta)
|
||||||
{ /* FIXME: We merely look for includes. We should honor blocks. */
|
{ /* FIXME: We merely look for includes. We should honor blocks. */
|
||||||
if (includes)
|
if (includes)
|
||||||
|
|
Loading…
Reference in a new issue