Convert images to images instead of links #5
Loading…
Reference in New Issue
No description provided.
Delete Branch "f/gmitohtml:image-output"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Image links will result in a
img
tag instead of aa
tag. Thisbehaviour 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 ?
Any update on this @tslocum ?
Thanks for your contributions. I plan on reviewing your PRs over the next week or so.
@ -1,4 +1,4 @@
package main
package gmitohtml
Please do not rename the package.
This was intended, see my initial PR comment.
@ -132,3 +131,1 @@
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
Please move this comment to just before
if isImage && Config.ConvertImages {
.@ -135,0 +138,4 @@
}
}
if isImage && Config.ConvertImages {
Please de-duplicate the code in these blocks to your best ability.