Comments (8)
You could set a global variable to save repeating the command, and awk
may be simpler:
global_vars:
- name: pattern
type: echo
params:
echo: awk '{print "<li>" $0 "</li>"}'
then each item is:
- name: flist1
type: shell
params:
cmd: echo "{{form.list1}}" | {{pattern}}
However, whatever I do I get alignment problems with the output.
from espanso.
No, it separates the items in the list.
<li>three</li>
<li>four</li>
<li>five</li>
I'm only testing one of the fields, with three items.
from espanso.
great solution ! it works like a charm, and surely with quotes in the text :)
from espanso.
What exactly do your sed
lines do? I'm struggling with several unknown option to s'
, which are making it difficult for me to work out.
They take the list and wrap each item in <li></li>
?
from espanso.
yes, the idea is to make a < li> for each line of the multiline text.
from espanso.
alignment is not my main concern for now.
Thanks for this code, you're right, pattern will be useful here !
but it will put an < li> tag around the whole multiline text, won't it ?
from espanso.
You're welcome.
from espanso.
Whilst pursuing a train of thought, I've done some investigation.
If the {{pattern}}
isn't going to be used elsewhere, it can be defined in vars:
within the main expansion, to save having a global_vars:
entry. It only gets generated once, no matter how many times you use it.
from espanso.
Related Issues (20)
- unable to start service: timed out when keyboard layout includes nodeadkeys HOT 1
- Detect module not working HOT 2
- Issue with Deleting Text After Inserting a Snippet HOT 3
- dev branch failed to build the windows resources
- Error after creating yaml files HOT 2
- bug: espanso presses Alt when entering/exiting choice dialogs
- espanso won't start HOT 7
- Restart loop with "espanso service register" HOT 1
- License clarification HOT 4
- Espanso doesn't start despite no other process running HOT 4
- Espanso stops when Ubuntu sleeps and does not restart upon wake HOT 1
- Strange Behavior on Wayland + gnome HOT 2
- Espanso not working on Arch Linux Wayland after KDE Plasma 6 Update (Keyboard layout bug) HOT 5
- App-specific configurations Not working in Linux with x11 HOT 1
- A white blob appears on starting Espanso HOT 5
- I don't use ([\s\S]+) regex HOT 2
- Replace string containing $ not properly returned HOT 3
- ALT+183 gives β (expected Γ) HOT 7
- Rename the Installable in Mac (remove M1 from `Espanso-Mac-M1`)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from espanso.