emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HowTo: EWW: Tagging regions with properties


From: Stefan Monnier
Subject: Re: HowTo: EWW: Tagging regions with properties
Date: Mon, 12 Dec 2022 10:04:31 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

> An around advice on shr-tag-li puts text  property 'li with value
> 'eww-tag on the region produced by rendering from the <li> tag.

[ I assume you don't really mean that and it's the `eww-tag` *property*
  which gets the `li` *value*, right?  Nitpick: I suggest you use
  `shr-tag` as property name, since it's done by `shr` rather than by `eww`,
  and `shr` is also used in other contexts such as by Gnus.  ]

> I suspect it's because some other part of shr ie outside of shr-tag-li
> in this instance shifts the block of text from the <li> tag to get it
> indented --- and I was hoping that default stickiness of text
> properties would just take care of that -- sdly, that doesn't
> happen. So question: How do I achieve what I want?

Text properties are fundamentally "not sticky" (they're defined as
adding a property to each character individually).  The stickiness
applies only to a few special cases, basically those that use
`insert-and-inherit`.  So you'll probably have to change `shr.el` so it
uses `insert-and-inherit` when inserting that whitespace.

Another approach might be to rely on overlays rather than text
properties.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]