user/dev discussion of public-inbox itself
 help / color / mirror / Atom feed
* [PATCH] examples/cgit-commit-filter: improve quoted text handling
@ 2021-02-13  2:15 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2021-02-13  2:15 UTC (permalink / raw)
  To: meta

With an example such as:

	something before "quoted phrase" something after

The Xapian will now see:

	[ "something before", "quoted phrase", "something after" ]

whereas before it would see:

	[ "something before", "quoted", "phrase", "something after" ]

which should improve search results accuracy when looking
up commits by commit title (subject).
---
 examples/cgit-commit-filter.lua | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/examples/cgit-commit-filter.lua b/examples/cgit-commit-filter.lua
index 8f9d3eb5..9614c944 100644
--- a/examples/cgit-commit-filter.lua
+++ b/examples/cgit-commit-filter.lua
@@ -32,7 +32,8 @@ function filter_close()
 			html(buffer)
 		else
 			html('<a href="' .. u .. '?x=t&amp;q=')
-			html_url_arg('"' .. buffer .. '"')
+			s = string.gsub(buffer, '"', '""')
+			html_url_arg('"' .. s .. '"')
 			html('"><tt>')
 			html_txt(buffer)
 			html('</tt></a>')

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-02-13  2:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-13  2:15 [PATCH] examples/cgit-commit-filter: improve quoted text handling Eric Wong

user/dev discussion of public-inbox itself

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/meta
	git clone --mirror http://czquwvybam4bgbro.onion/meta
	git clone --mirror http://hjrcffqmbrq6wope.onion/meta
	git clone --mirror http://ou63pmih66umazou.onion/meta

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 meta meta/ https://public-inbox.org/meta \
		meta@public-inbox.org
	public-inbox-index meta

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.mail.public-inbox.meta
	nntp://ou63pmih66umazou.onion/inbox.comp.mail.public-inbox.meta
	nntp://czquwvybam4bgbro.onion/inbox.comp.mail.public-inbox.meta
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.mail.public-inbox.meta
	nntp://news.gmane.io/gmane.mail.public-inbox.general
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for the project(s) associated with this inbox:

	https://80x24.org/public-inbox.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git