-
The problem: converting a title list into a string which can later be parsed as a title list. For example, given the input This comes up fairly frequently using Is there a way to do this with filters without having to resort to macros? If not, I suggest we add a filter that offers an affordance for it. It could take them form of:
Note I haven't given any thought to naming. It also occurs to me that the "encapsulate" option could also be implemented as Thoughts @Jermolene ? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 11 replies
-
In normal cases I use "$set name filter" to get this conversion
|
Beta Was this translation helpful? Give feedback.
-
That's right and I'm in favour of a filter, that gives us this info. Especially since $vars doesn't do the trick.
But with my usecases I also found out, that if I need a "title list string", I need it several times. So having a variable is a plus performance wise. ... So if we have a filter, we need to make sure, that it is cached, if possible. |
Beta Was this translation helpful? Give feedback.
-
I agree with the proposal to add a filter operator to stringify a list. @pmario is correct that the |
Beta Was this translation helpful? Give feedback.
-
PR will be created soon. |
Beta Was this translation helpful? Give feedback.
-
@pmario I've pushed my work so far: #5665 I think the name of the operator needs further consideration, and I still need to add some more info to the docs. |
Beta Was this translation helpful? Give feedback.
I agree with the proposal to add a filter operator to stringify a list. @pmario is correct that the
<$set filter=>
formulation is often preferable because it enables the result to be cached for reuse, and we perhaps might note that in the docs.