smacademic / project-bdf

project-bdf created by GitHub Classroom
2 stars 0 forks source link

Format fix to remove markdown syntax from post/reply #43

Closed calebeda closed 5 years ago

calebeda commented 5 years ago

The cause for the bot posting replies that still contained markdown syntax was that the bot was posting/replying with an array that stored the transcribed text. The quick fix for this was to create a function that creates an empty string variable then concatenates each element in order from the array to the string variable and then finally returns the string variable. The function was then implemented where ever the TranscribeImages() function was called.

afig commented 5 years ago

Nice fix @calebeda. This definitely fixes the issue with the original array representation being posted to Reddit.

I changed the title of the corresponding issue to be more accurate. The problem was that the original string did not follow the Markdown syntax. The square brackets, extraneous commas, and new line characters were a part of Python's representation of strings. What we are doing here is converting that string into valid Markdown.

Good work with what has been done so far. However, I feel that we could do a bit more to make the formatting even nicer. Here are some suggestions:

These are just suggestions, and not all three have to be addressed right away. If they are not addressed then they can be opened as separate issues.

baconbm commented 5 years ago

Looks good to me, and I think Andrew brings up some good points. For the purposes of this PR I would approve the code currently in this PR however if you decide to add any of Andrew's suggestions I will hold off.

calebeda commented 5 years ago

I added a new function with commit b77df85c that addresses the new line issue. It adds a second '\n' to single new line calls and it ignores double new line calls that had already existed before the function call.