Convert images to images instead of links #5

Merged
tslocum merged 3 commits from f/gmitohtml:image-output into master 1 year ago
f commented 1 year ago

Image links will result in a img tag instead of a a tag. This
behaviour is disabled by default and can be enabled by adding the
following line to to config file:

convertimages: true

To get access to the config in the convert file, I had to move the
config file inside the gmitohtml namespace. This is specially handy
later on if the config file contains other settings which are useful for
the rest of the codebase.

But this resolves #4 only partially, because it seems that binary files are not supported jet. Can you confirm that @tslocum ?

Image links will result in a `img` tag instead of a `a` tag. This behaviour is disabled by default and can be enabled by adding the following line to to config file: convertimages: true To get access to the config in the convert file, I had to move the config file inside the gmitohtml namespace. This is specially handy later on if the config file contains other settings which are useful for the rest of the codebase. But this resolves #4 only partially, because it seems that binary files are not supported jet. Can you confirm that @tslocum ?
f added 1 commit 1 year ago
586b293bef Convert images to images instead of links
f commented 1 year ago
Poster

Any update on this @tslocum ?

Any update on this @tslocum ?
Owner

Thanks for your contributions. I plan on reviewing your PRs over the next week or so.

Thanks for your contributions. I plan on reviewing your PRs over the next week or so.
tslocum requested changes 1 year ago
config.go Outdated
package main
package gmitohtml
tslocum commented 1 year ago
Owner

Please do not rename the package.

Please do not rename the package.
f commented 1 year ago
Poster

This was intended, see my initial PR comment.

This was intended, see my initial PR comment.
tslocum marked this conversation as resolved
link = append(link, []byte(`</a>`)...)
result = append(result, link...)
result = append(result, []byte("<br>")...)
// If link ends with gif/png/jpg, add a image instead of a link
tslocum commented 1 year ago
Owner

Please move this comment to just before if isImage && Config.ConvertImages {.

Please move this comment to just before `if isImage && Config.ConvertImages {`.
f marked this conversation as resolved
}
}
if isImage && Config.ConvertImages {
tslocum commented 1 year ago
Owner

Please de-duplicate the code in these blocks to your best ability.

Please de-duplicate the code in these blocks to your best ability.
f marked this conversation as resolved
f added 1 commit 1 year ago
0bec3c3eef Fix wrong package name and clean up tag-building
f added 1 commit 1 year ago
tslocum merged commit 8e8eef57e2 into master 1 year ago

Reviewers

tslocum requested changes 1 year ago
The pull request has been merged as 8e8eef57e2.
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
There is no content yet.