I am trying to export a document to Pages/Word but first I need to configure the style. I think this can be done by modifying the Copy to Rich Text Action. However, I am not sure how to add more than one parameter too the Action to change the HTML css style?
There are some serious limitations to what HTML/CSS can be converted by Apple’s HTML > Rich Text, so you can’t get too complicated, but what you want is to create a style element, and put your styles there. Something like:
var template = `<html>
<style>
body {
font-family:'Verdana';
line-height:1.8em;
}
h3 {
font-size: 13pt;
font-weight: bold;
}
ul {
enumeration-format:"•";
}
</style>
<body>
[[content]]
</body>
</html>
`;
Does HTML/CSS support adding space after unordered list items and a paragraph? I tried various options and nothing seems to add space after a list of but before the paragraph.
I tried adding these but nothing works
li {
list-style: disc inside;
padding: 5px 0px 0px;
}
p {
margin-top: 10;
}
p + ul {
margin-top: 10;
}
I don’t know of any useful reference on what exactly will translate and what will not using these Apple conversion routines, but I would not expect most of those margin/padding type attributes to make it through in a conversion to RTF/Rich-Text.
RTF does not have a lot of the same concepts as CSS, and those attributes which cannot be directly supported just get ignored.