1
0
mirror of https://github.com/makew0rld/amfora.git synced 2024-06-01 18:31:08 +00:00

Merge branch 'master' into commands

This commit is contained in:
mntn 2021-12-10 22:35:36 -05:00
commit cf07d9ee2c
7 changed files with 34 additions and 17 deletions

View File

@ -12,5 +12,6 @@ jobs:
with:
# A PR will be sent to github.com/Homebrew/homebrew-core to update this formula:
formula-name: amfora
download-url: https://github.com/makeworld-the-better-one/amfora.git
env:
COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TOKEN }}

View File

@ -43,6 +43,8 @@ builds:
goarch: arm
- goos: openbsd
goarch: arm64
- goos: windows
goarch: arm
archives:
- format: binary

View File

@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.9.2] - 2021-12-10
### Fixed
- Preformatted text color showing even when `color = false` (bug since v1.8.0 at least) (#278)
- Link numbers and link text in color even when `color = false` (regression in v1.9.0) (#278)
## [1.9.1] - 2021-12-08
### Fixed
- Deadlock when loading an invalid `about:` URL (#277)
- Crash when rendering text from stdin
## [1.9.0] - 2021-12-07
### Added
- Support for version 1.1 JSON feeds

View File

@ -21,15 +21,15 @@ clean:
.PHONY: install
install: amfora amfora.desktop
$(INSTALL) -d $(PREFIX)/bin/
$(INSTALL) -m 755 amfora $(PREFIX)/bin/amfora
$(INSTALL) -d $(PREFIX)/share/applications/
$(INSTALL) -m 644 amfora.desktop $(PREFIX)/share/applications/amfora.desktop
$(INSTALL) -d $(DESTDIR)$(PREFIX)/bin/
$(INSTALL) -m 755 amfora $(DESTDIR)$(PREFIX)/bin/amfora
$(INSTALL) -d $(DESTDIR)$(PREFIX)/share/applications/
$(INSTALL) -m 644 amfora.desktop $(DESTDIR)$(PREFIX)/share/applications/amfora.desktop
.PHONY: uninstall
uninstall:
$(RM) -f $(PREFIX)/bin/amfora
$(RM) -f $(PREFIX)/share/applications/amfora.desktop
$(RM) -f $(DESTDIR)$(PREFIX)/bin/amfora
$(RM) -f $(DESTDIR)$(PREFIX)/share/applications/amfora.desktop
# Development helpers

View File

@ -16,7 +16,7 @@ import (
)
var (
version = "v1.9.0"
version = "v1.9.2"
commit = "unknown"
builtBy = "unknown"
)
@ -94,6 +94,7 @@ func main() {
}
display.NewTabWithURL(url)
} else if !isStdinEmpty() {
display.NewTab()
renderFromStdin()
} else {
display.NewTab()

View File

@ -540,13 +540,10 @@ func Reload() {
func URL(u string) {
t := tabs[curTab]
if strings.HasPrefix(u, "about:") {
if final, ok := handleAbout(t, u); ok {
t.addToHistory(final)
}
return
go goURL(t, u)
} else {
go goURL(t, fixUserURL(u))
}
go goURL(t, fixUserURL(u))
}
func RenderFromString(str string) {

View File

@ -231,13 +231,13 @@ func convertRegularGemini(s string, numLinks, width int, proxied bool) (string,
wrappedLink = wrapLine(linkText, width,
strings.Repeat(" ", indent)+
`["`+strconv.Itoa(num-1)+`"]`+linkTag,
`["`+strconv.Itoa(num-1)+`"]`,
`[::-][""]`,
false, // Don't indent the first line, it's the one with link number
)
wrappedLink[0] = `[::b][` + strconv.Itoa(num) + "[][::-]" + spacing +
`["` + strconv.Itoa(num-1) + `"]` + linkTag +
`["` + strconv.Itoa(num-1) + `"]` +
wrappedLink[0] + `[::-][""]`
}
}
@ -341,8 +341,12 @@ func RenderGemini(s string, width int, proxied bool) (string, []string) {
// Lines are modified below to always end with \r\n
buf = strings.TrimSuffix(buf, "\r\n")
rendered += fmt.Sprintf("[%s]", config.GetColorString("preformatted_text")) +
buf + fmt.Sprintf("[%s:%s:-]\r\n", config.GetColorString("regular_text"), config.GetColorString("bg"))
if viper.GetBool("a-general.color") {
rendered += fmt.Sprintf("[%s]", config.GetColorString("preformatted_text")) +
buf + fmt.Sprintf("[%s:%s:-]\r\n", config.GetColorString("regular_text"), config.GetColorString("bg"))
} else {
rendered += buf + "\r\n"
}
}
// processRegular processes non-preformatted sections