chrome-tab-modifier icon indicating copy to clipboard operation
chrome-tab-modifier copied to clipboard

Return blank when an element doesn't exist

Open Zeego opened this issue 7 years ago • 2 comments

I'm wanting to put the main heading of a page (of a certain website) in the title. Usually this will be h1 but sometimes h2 has been used instead.

So the rule for my title looks something like this: {div.[name] h1} {div.[name] h2}

(where [name] is the name of a valid class)

What's happening is if h1 doesn't exist but h2 does, the title looks like: {div.[name] h1} [value of h2]

And if h1 exists but h2 doesn't, the title looks like: [value of h1] {div.[name] h2}

What I'd like is to display a blank if h1 or h2 doesn't exist, instead of the rule. That way, it would either be: [value of h1] [blank] or [blank] [value of h2]

Is this possible?

Zeego avatar Jan 09 '18 14:01 Zeego

Even better would be to stop if h1 exists, so that if both h1 and h2 exist it only displays h1

Zeego avatar Jan 09 '18 15:01 Zeego

Hi @Zeego,

Thanks for contributing. Unfortunately, I've already stated about this behavior. Check this ref. https://github.com/sylouuu/chrome-tab-modifier/pull/86

Best

sylouuu avatar Jan 09 '18 15:01 sylouuu