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)
- Add the ability to trigger expansions using the CLI HOT 12
- Some kind of tooltip in forms
- Allow user to mark some word that won't be uppercased with "uppercase_style: capitalize_words"
- 'includes:' doesn't omit regular matches
- Multiline replacement doesn't get replaced correctly sometimes and instead letter 'v' is the output HOT 2
- The maximum length of a "regex match" is set to 30 characters HOT 1
- Request for 32-bit Support for Espanso HOT 1
- Incorrect cursor placement HOT 4
- Exclude firefox HOT 1
- Won't start saying that it's not in the Applications folder, but it is HOT 5
- espanso match list --json returns wrong replace HOT 1
- General rust code quality
- Can't create snippet to add $|$ (the actual set of characters) HOT 6
- We have other ways than having this many traits
- Unlimited regex pattern length HOT 1
- Expanso auto installed itself on a fresh copy of Windows 10 and won't uninstall HOT 2
- Some symbols that indicate the end of a word don't trigger whole-word matches HOT 1
- `espanso package update --all` command HOT 2
- How can we update `json` cpp library? HOT 2
- Nested Matches that include Text and Images HOT 1
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.