rgb-cln/doc
Matt Whitlock 09d52b3cb4 doc: escape more naughty underscores
The only time underscores aren't special in Markdown is when they appear
in preformatted text. We have gotten away with not escaping underscores
where an asterisk-enclosed span or the paragraph ends before the next
underscore appears, but this is fragile and bad practice. Conversely,
there are many places where we have not escaped underscores but needed
to.

Escape all underscores that do not appear in preformatted blocks or
preformatted spans and are not themselves delineating emphasized spans.

The changes in this commit are exactly the result of executing the
following Bash code:

```bash
e=':x;'           	# begin loop
e+='s/^'          	# anchor match at beginning of line
e+='('            	# begin capturing subexpression
	e+='('    	# begin list of alternatives
		e+='[^`_\\]|'        	# any mundane character, or
		e+='`([^`\\]|\\.)*`|'	# backtick-enclosed span, or
		e+='\b_|_\b|'        	# underscore at boundary, or
		e+='\\.'             	# backslash-escaped character
	e+=')*'   	# any number of the preceding alternatives
e+=')'            	# end capturing subexpression
e+='\B_\B/\1\\_/;'	# escape non-formatting underscore
e+='tx'           	# repeat loop if we escaped an underscore

escape_underscores=(
	sed

	# use extended regular expressions
	-E

	# skip over indented blocks (following an empty line)
	-e '/^$/{:i;n;/^( {4,}|\t)/bi}'

	# skip over preformatted blocks
	-e '/^\s*```/,/^\s*```/{p;d}'

	# skip over generated sections
	-e '/GENERATE-FROM-SCHEMA-START/,/GENERATE-FROM-SCHEMA-END/{p;d}'

	# escape underscores
	-e "${e}"
)

"${escape_underscores[@]}" -i doc/*.[0-9].md
```

Changelog-None
2022-12-12 15:34:00 +10:30
..
release-notes doc: Fixed typo in the release notes 2018-06-18 12:45:00 +02:00
schemas lightningd: don't announce names as DNS by default. 2022-12-08 11:04:53 +01:00
.gitignore Add documentation. 2015-07-18 10:46:53 +09:30
BACKUP.md use 'postgres' driver (not postgresql). Include plain url to guide, as link is broken on RTD. 2022-08-22 11:21:59 -04:00
CHANGELOG.md docs: Add configuration for the sphinx documentation generator 2019-02-18 02:42:29 +00:00
FAQ.md doc: update references to old BOLTs repo. 2022-09-29 16:10:57 +09:30
FUZZING.md doc: add a document about our fuzz testing integration 2020-10-21 19:34:39 +02:00
GOSSIP_STORE.md doc/GOSSIP_STORE.md: document the gossip_store file format. 2022-09-24 15:22:27 +09:30
HACKING.md doc: update references to old BOLTs repo. 2022-09-29 16:10:57 +09:30
INSTALL.md doc: Move M1 instructions install to its own section 2022-11-01 18:25:21 +01:00
MAKING-RELEASES.md Makefile: add targets to upgrade pyln versions, push releases. 2022-09-22 11:41:11 +02:00
Makefile doc: check-manpages: add check for unescaped underscores 2022-12-12 15:34:00 +10:30
PLUGINS.md plugins: set non_numeric_ids flag based on getmanifest `nonnumericids` field. 2022-11-21 11:23:54 +01:00
REPRODUCIBLE.md doc: Spell out the reprobuild instructions for each distro 2022-07-21 15:21:12 -05:00
STYLE.md Changelog-None 2022-08-22 11:21:19 -04:00
TOR.md doc: mention ip discovery only active when no addresses are announced 2022-07-12 13:59:46 -05:00
bitcoin.bib bitcoin.bib: Add Satoshi paper URL and date 2018-03-04 03:22:32 +01:00
commit-tx.eps Add documentation. 2015-07-18 10:46:53 +09:30
commit-tx.svg Add documentation. 2015-07-18 10:46:53 +09:30
conf.py doc: Update lightning.readthedocs.org project name after rebrand 2022-05-14 11:43:46 +09:30
deployable-lightning.lyx udpate broken link 2018-06-08 17:56:48 +02:00
deployable-lightning.pdf Regenerate PDF. 2015-11-20 06:45:19 +10:30
dual-anchor-diag1.eps Add documentation. 2015-07-18 10:46:53 +09:30
dual-anchor-diag1.svg Add documentation. 2015-07-18 10:46:53 +09:30
dual-anchor-diag2.eps Add documentation. 2015-07-18 10:46:53 +09:30
dual-anchor-diag2.svg Add documentation. 2015-07-18 10:46:53 +09:30
dual-anchor-diag3.eps Add documentation. 2015-07-18 10:46:53 +09:30
dual-anchor-diag3.svg Add documentation. 2015-07-18 10:46:53 +09:30
dual-anchor-diag4.eps doc: fix flaw in escape transactions. 2015-07-20 14:07:25 +09:30
dual-anchor-diag4.svg doc: fix flaw in escape transactions. 2015-07-20 14:07:25 +09:30
dual-anchor-final.eps doc: fix flaw in escape transactions. 2015-07-20 14:07:25 +09:30
dual-anchor-final.svg doc: fix flaw in escape transactions. 2015-07-20 14:07:25 +09:30
dual-anchor-take2.svg Add documentation. 2015-07-18 10:46:53 +09:30
dual-anchor.svg Add documentation. 2015-07-18 10:46:53 +09:30
htlc.eps Add documentation. 2015-07-18 10:46:53 +09:30
htlc.svg Add documentation. 2015-07-18 10:46:53 +09:30
index.rst doc: document autoclean-once command. 2022-12-06 10:42:05 +01:00
lightning-addgossip.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-autoclean-once.7.md doc: document autoclean-once command. 2022-12-06 10:42:05 +01:00
lightning-autoclean-status.7.md doc: manpages and schemas for autoclean-status. 2022-09-22 15:19:46 +02:00
lightning-batching.7.md lightningd: allow a connection to specify db batching. 2022-09-22 15:19:46 +02:00
lightning-bkpr-channelsapy.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-bkpr-dumpincomecsv.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-bkpr-inspect.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-bkpr-listaccountevents.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-bkpr-listbalances.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-bkpr-listincome.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-check.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-checkmessage.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-cli.1.md lightning-cli: support --filter parameter. 2022-11-09 20:25:58 +10:30
lightning-close.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-commando-rune.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-commando.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-connect.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-createinvoice.7.md bolt12: use spec field names, update decode API. 2022-11-09 15:08:03 +01:00
lightning-createonion.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-datastore.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-decode.7.md decode: print unknown fields in bolt12 strings. 2022-11-09 15:08:03 +01:00
lightning-decodepay.7.md doc: update references to old BOLTs repo. 2022-09-29 16:10:57 +09:30
lightning-deldatastore.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-delexpiredinvoice.7.md doc: manpages and schemas for autoclean-status. 2022-09-22 15:19:46 +02:00
lightning-delforward.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-delinvoice.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-delpay.7.md lightningd: allow delpay to delete a specific payment. 2022-09-22 15:19:46 +02:00
lightning-disableoffer.7.md offers: make them always unsigned. 2022-11-09 15:08:03 +01:00
lightning-disconnect.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-emergencyrecover.7.md doc: Add documentation for new RPCs and a FIXME: in fromschema.py 2022-07-14 12:24:48 -05:00
lightning-feerates.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-fetchinvoice.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-fundchannel.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-fundchannel_cancel.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-fundchannel_complete.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-fundchannel_start.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-funderupdate.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-fundpsbt.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-getinfo.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-getlog.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-getroute.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-help.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-hsmtool.8.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-invoice.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-keysend.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-listchannels.7.md doc: update references to old BOLTs repo. 2022-09-29 16:10:57 +09:30
lightning-listconfigs.7.md lightningd: don't announce names as DNS by default. 2022-12-08 11:04:53 +01:00
lightning-listdatastore.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-listforwards.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-listfunds.7.md wallet: mark coinbase outputs as 'immature' until spendable 2022-11-09 11:55:25 +01:00
lightning-listhtlcs.7.md lightningd: add `listhtlcs` to list all the HTLCs we know about. 2022-09-22 15:19:46 +02:00
lightning-listinvoices.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-listnodes.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-listoffers.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-listpays.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-listpeers.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-listsendpays.7.md lightningd: listsendpays always has groupid. 2022-09-22 15:19:46 +02:00
lightning-listtransactions.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-makesecret.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-multifundchannel.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-multiwithdraw.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-newaddr.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-notifications.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-offer.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-offerout.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-openchannel_abort.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-openchannel_bump.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-openchannel_init.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-openchannel_signed.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-openchannel_update.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-parsefeerate.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-pay.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-ping.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-plugin.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-recoverchannel.7.md doc: Add documentation for new RPCs and a FIXME: in fromschema.py 2022-07-14 12:24:48 -05:00
lightning-reserveinputs.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-sendcustommsg.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-sendinvoice.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-sendonion.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-sendonionmessage.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-sendpay.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-sendpsbt.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-setchannel.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-setchannelfee.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-signmessage.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-signpsbt.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-staticbackup.7.md doc: Typo 2022-08-19 10:27:09 -04:00
lightning-stop.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-txdiscard.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-txprepare.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-txsend.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-unreserveinputs.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-utxopsbt.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightning-waitanyinvoice.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-waitblockheight.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-waitinvoice.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightning-waitsendpay.7.md wallet: Load and value `completed_at` timestamp from DB 2022-09-14 13:14:10 +02:00
lightning-withdraw.7.md doc: escape output types (esp `short_channel_id`). 2022-09-12 14:00:41 +02:00
lightningd-config.5.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightningd-rpc.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
lightningd.8.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
ln-draft-fig1.eps doc: add figures from LN draft (thanks Joseph!). 2015-07-20 14:07:40 +09:30
ln-draft-fig2.eps doc: add figures from LN draft (thanks Joseph!). 2015-07-20 14:07:40 +09:30
reckless.7.md doc: escape more naughty underscores 2022-12-12 15:34:00 +10:30
undoc-flags.json lightningd: allow extra tlv types in non-experimental mode. 2022-09-22 17:19:11 +09:30