Commit graph

17 commits

Author SHA1 Message Date
Gusted
f537c0bda3
Allow for multiple inline blocks in a paragraph
- Adjust the inlineBlock regex to match until the first `]` and `}`,
this allows for multiple inline blocks to be present on the same line.
- Test added.
2024-07-29 17:49:02 +02:00
Niklas Fasching
f27340ed5e Add \ to emphasis post chars to allow immediate explicit line break
Post chars are defined in (nth 1 org-emphasis-regexp-components) in emacs org.
When I initially adapted the list of chars for go, I failed to check how it's
actually used (further down in org.el):
  (string-match (concat "[" (nth 1 erc) "\n]") (char-to-string (char-after (point))))

Due to the surrounding [] the `\\` in
  '("-[:space:]('\"{" "-[:space:].,:!?;'\")}\\[" "[:space:]" "." 1)

is actually a literal backslash, not an escape of the opening bracket I
guess. I'm not in the mood for thinking any harder about this, so let's hope
this is right. yolo.
2022-09-20 17:16:40 +02:00
Niklas Fasching
a520664dc7 emphasis: Fix reading of prev/next rune for multibyte characters 2022-06-18 16:10:19 +02:00
Niklas Fasching
8e11cc3db0 Fix html entities: support \<entity>{} and prevent partial replacements 2022-04-28 18:09:42 +02:00
Niklas Fasching
9995b3cdad html: Improve link abbreviation (#+LINK) resolution
Handle `%s`/`%h` interpolation and add support for shorthand of prefix only
links / links with empty tag (i.e. `[example]` instead of [example:]). See
[1] and [2]. As so often we don't match org mode output completely but our
output looks sane enough to me so let's move along for now.

[1] https://orgmode.org/manual/Link-Abbreviations.html
[2] https://github.com/bzg/org-mode/blob/main/lisp/ol.el#L1011
2021-10-25 16:50:15 +02:00
Niklas Fasching
84d56e9562 html: Rewrite local links to .org files to .html
emacs rewrites links to `.org` files to corresponding links with `.html`
extension in the html export.
2021-01-02 20:47:55 +01:00
Niklas Fasching
d85768891c html: Support links with image descriptions
Turns out Org mode supports image links natively and we don't have to go out of
spec!

From https://orgmode.org/manual/Images-in-HTML-export.html:

[...] if the description part of the Org link is itself another link, such as
‘file:’ or ‘http:’ URL pointing to an image, the HTML export back-end in-lines
this image and links to [...]
2020-06-28 21:16:46 +02:00
Niklas Fasching
9f7e8a8fbd Implement #+MACRO 2020-04-17 16:41:06 +02:00
Niklas Fasching
1e36b3b46b Implement #+LINK 2020-04-17 15:59:03 +02:00
Niklas Fasching
4b56810a65 Implement inline export blocks
https://orgmode.org/manual/Quoting-HTML-tags.html
2020-04-16 14:58:23 +02:00
Niklas Fasching
3018ace8d0 Implement inline source blocks
https://orgmode.org/manual/Structure-of-Code-Blocks.html
2020-04-16 14:58:13 +02:00
Niklas Fasching
da99094e20 Fix explicit line break parsing
It's possible for the input to end right after the explicit line break,
i.e. after the second \. This currently leads to an out of range index into
input (as the for loop starts with start+2 and [start:start+1] is the \\).
2019-01-12 20:08:17 +01:00
Niklas Fasching
63fef04fb3 Add support for timestamps 2019-01-06 21:01:47 +01:00
Niklas Fasching
d1054063cf Anchor inline regexps and improve sub/super-script
The regexps are meant to extract a match immediately following the cursor - the
anchor should have been there from the beginning...

Also empty sub/superscript doesn't make sense - nested sub/superscript does
make sense but yagni.
2018-12-20 15:43:16 +01:00
Niklas Fasching
fb837e04af Fix parsing of regular links enclosed in [] 2018-12-19 12:24:02 +01:00
Niklas Fasching
7c082fc627 Change img url http -> https where possible for cleaner gh-pages console 2018-12-11 22:12:51 +01:00
Niklas Fasching
fb6bc2d7de Split example.org into separate files
... hopefully correctly

This will hopefully improve ease of developing (more granular test results) and
prepares us for adding example org->html renders for gh-pages
2018-12-11 14:43:44 +01:00