How do I disable superfluous HTML style attributes when converting HTML to markdown or org-mode? #9783
-
How do I disable superfluous HTML style attributes when converting HTML to markdown or org-mode? When I convert the attached HTML to org-mode, I get:
I don't want the attributes Attached HTML:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 9 replies
-
As a workaround, I remove the style attribute using these postprocessors:
|
Beta Was this translation helpful? Give feedback.
-
You could try to use markdown variants, such as You can also explicitly specify the keyword argument; it need not be
simply the variable name prefixed with a colon. For example,
(cl-defun bar (&key (a 1) ((baz b) 4)))
specifies a keyword `:a` that sets the variable `a` with default value
1, as well as a keyword `baz` that sets the variable `b` with default
value 4. In this case, because `baz` is not self-quoting, you must quote
it explicitly in the function call, like this: |
Beta Was this translation helpful? Give feedback.
-
You could use a Lua filter to remove these attributes from CodeBlock elements. I suspect we shouldn't be emitting these: currently we just pass through any attribute on a CodeBlock. But I don't know enough about org-mode to say. @tarleb ? |
Beta Was this translation helpful? Give feedback.
You could try to use markdown variants, such as
markdown_strict
. Copying your html to the clipboard (macOS) and then run the commandpbpaste | pandoc -f html -t markdown_strict -o test.md
, the output is as follows: