jgm / jgm/djot.lua

Use `"\\%0"` as replacement string to escape chars in Lua rather than function

Open
#16 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Lua
Stars
80
Forks
11
PR merge metrics
No merged PRs in 30d

Description

https://github.com/jgm/djot.lua/blob/a0583ef8270d025b3e86ef521b35f7397cf7215b/djot-writer.lua#L17

It is probably more efficient to use `"\\%0"` as the replacement rather than a function. In a replacement string `%0` gets replaced with the whole match, `%1` with the first capture group and so on up to `%9`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.