@liustack/markpress 0.3.1 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/main.js +6 -3
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -568,7 +568,8 @@ const defaultStyles = {
568
568
  li: `${F} margin: 0.4em 0; color: #1d1d1f;`,
569
569
  // Links — WeChat blue
570
570
  a: "color: #576b95; text-decoration: none;",
571
- // Images
571
+ // Images — no top margin: when image is the first element (e.g. cover),
572
+ // top margin creates excessive spacing in WeChat editor.
572
573
  img: "max-width: 100%; height: auto; display: block; margin: 0 auto 1.5em; border-radius: 10px;",
573
574
  // Tables — minimalist: collapse borders, thin lines
574
575
  table: `${F} width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: 16px; border-radius: 2px;`,
@@ -882,7 +883,9 @@ async function render$1(options) {
882
883
  const html = String(file);
883
884
  const outputPath = path.resolve(output);
884
885
  fs.mkdirSync(path.dirname(outputPath), { recursive: true });
885
- fs.writeFileSync(outputPath, html, "utf-8");
886
+ const fileHtml = `<meta charset="utf-8">
887
+ ${html}`;
888
+ fs.writeFileSync(outputPath, fileHtml, "utf-8");
886
889
  let copied = false;
887
890
  if (options.copy) {
888
891
  const { copyToClipboard } = await import("./clipboard-pLkenrrh.js");
@@ -1029,7 +1032,7 @@ function normalizeTarget(input) {
1029
1032
  if (normalized === "x" || normalized === "twitter") return "x";
1030
1033
  throw new Error(`Unsupported target: ${input}. Supported targets: wechat, x, twitter`);
1031
1034
  }
1032
- program.name("markpress").description("Convert Markdown into editor-ready HTML (WeChat MP or X Articles)").version("0.3.1").requiredOption("-i, --input <path>", "Input Markdown file path").requiredOption("-o, --output <path>", "Output HTML file path").option("-t, --target <target>", "Render target: wechat | x | twitter", "wechat").option("-c, --copy", "Copy rendered HTML to system clipboard").action(async (options) => {
1035
+ program.name("markpress").description("Convert Markdown into editor-ready HTML (WeChat MP or X Articles)").version("0.3.3").requiredOption("-i, --input <path>", "Input Markdown file path").requiredOption("-o, --output <path>", "Output HTML file path").option("-t, --target <target>", "Render target: wechat | x | twitter", "wechat").option("-c, --copy", "Copy rendered HTML to system clipboard").action(async (options) => {
1033
1036
  try {
1034
1037
  const target = normalizeTarget(options.target);
1035
1038
  const renderer = target === "wechat" ? render$1 : render;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liustack/markpress",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "CLI for AI agents to convert Markdown into WeChat MP-ready HTML with inline styles, base64 images, and tag sanitization",
5
5
  "type": "module",
6
6
  "bin": {