Bug Report For Dpoll ― Improving How Polls Are Shown
utopian-io·@tdre·
0.000 HBDBug Report For Dpoll ― Improving How Polls Are Shown
This post discusses two bugs I encountered recently on one of my favorite Steem front ends. The dpoll site (http://dpoll.xyz), as many users know, lets you pose questions to fellow Steemians and record the answers on the Steem blockchain. It's a continually improving open source dcentralized app for fun or serious surveys.  #### Project Information * Repository: https://github.com/emre/dpoll.xyz * Project Name: dpoll * Publisher (if applicable): @emrebeyler ### Escaped Character Code Rendered Between Markdown Backticks The first of these two bugs involves the way Markdown is rendered. #### Expected Behavior An HTML character entitity between single backticks in markdown should render as the corresponding human legible symbol. For example, `'` in `That's not funny` should be rendered as an apostrophe. To show further, [this dPoll](https://busy.org/@tdre/lets-try-another-meme-is-this-one-amusing) is rendered correctly on Busy.org.  #### Actual Behavior On dPoll.xyz the character entitity code is shown in the rendered Markdown. The following image shows [the same poll](https://dpoll.xyz/detail/@tdre/lets-try-another-meme-is-this-one-amusing/) as rendered by the dPoll website.  #### Steps To Reproduce 1. Create a new poll. 2. Add Question. 3. Add a Description, including an inline snippet enclosed by back ticks (`` ` ``). There should be at least one HTML character that calls for entity encoding within the snippet. For example: ``` Lorem ipsum dolor sit amet. `This snippet's apostrophe shows the problem.` ``` 4. Add answers. 5. Submit the poll. #### Analysis And Suggested Solution I suspect this behavior is tied to [Line #39](https://github.com/emre/dpoll.xyz/blob/master/dpoll/templates/poll_detail.html#L39) in dpoll's `poll_detail.html` template. ```html <p> {{ poll.description |striptags | force_escape | markdown |safe }} </p> ``` Combining Django's [built-in template tags](https://docs.djangoproject.com/en/2.1/ref/templates/builtins/) this way could be tricky, particularly in regards to `force_escape`, which causes an HTML string to be escaped multiple times over. I am not sure what exact filter combination, if any, would eliminate the entity codes. But it's an option to consider. ### Edits Made in Other Front Ends Don't Display On dPoll This second bug I actually discovered while closely examing the example posts in the foregoing issue. It turns out that editing the post body on a different Steem front end (e.g. Busy.org) is not doing what many users would expect. This may or may not be by design. But I think it bears examination because it could be confusing. #### Expected Behavior When a user edits a post the most recent version is displayed on front ends that serve a general audience. #### Actual Behavior When a user edits a poll using a Steem blockchain frontend other than dPoll the changes are not visible on the website https://dPoll.xyz. For example, compare this post on [dPoll](https://dpoll.xyz/detail/@tdre/lets-try-another-meme-is-this-one-amusing/) and [Busy.org](https://busy.org/@tdre/lets-try-another-meme-is-this-one-amusing). __The post has been edited using Busy.org to correct a typo in the first paragraph.__ __I.e. `@rem-steem` replaces `rem-stem`.__  __But the change does not show up on dPoll.__  #### Steps To Reproduce 1. Create a poll on dPoll.xyz. 2. Edit the poll using Busy.org or Steemit.com #### Analysis And Suggested Solution I belive the disparity arises because dPoll is reading what it displays from `json_metadata.question` and `json_metadata.description` and thus cannnot pickup on changes that were made elsewhere. This can be seen in the [steemd.com](https://steemd.com/dpoll/@tdre/lets-try-another-meme-is-this-one-amusing) view.  While these are technically different properties from the post body and there is nothng wrong per se with writing custom `json_metadata` for dPoll's particular purpose, I expect the typical, non-technical user will find this confusing. One way this might be addressed is by comparing post's `created`property to its `last_edited` property and in cases where the two differ render the post's current blog body and title instead of `json_metadata.question` and `json_metadata.description`. Report(s) To The Maintainer - @tdre opened thes as issues [#97](https://github.com/emre/dpoll.xyz/issues/97) and [#98](https://github.com/emre/dpoll.xyz/issues/98) in the dpoll repository [here](https://github.com/emre/dpoll.xyz/issues). - The problem was mentioned to the developers' #bug-reports channel on discord.  --- #### GitHub Account https://github.com/tdreid 
👍 tdre, pataty69, enlighted, munhenhos, bhaski, amosbastian, tobias-g, leir, ulockblock, jaff8, rufans, helo, asaj, merlin7, bluesniper, ctime, codingdefined, steemtaker, phage93, mcfarhat, ceruleanblue, leduc1984, minnowsupport, gregoryhedrich, hope-on-fire, miniature-tiger, elysiian, sj-jeong, espoem, ascorphat, mops2e, peerzadaaabid, utopian.trail, lordneroo, techslut, minersean, erikaflynn, jakipatryk, suesa, che-shyr, didic, rewarding, walnut1, tykee, silviu93, dakeshi, elear, zoneboy, mcyusuf, gentleshaid, aussieninja, bflanagin, dssdsds, jayplayco, stem-espanol, skymin, jk6276.mons, jaxson2011, tsoldovieri, iamphysical, carloserp-2000, amestyj, eliaschess333, emiliomoron, tomastonyperez, elvigia, josedelacruz, joseangelvs, erickyoussif, fran.frey, aleestra, lorenzor, felixrodriguez, ydavgonzalez, joelsegovia, amart29, flores39, eastmael, dalz, scienceangel, alex-hm, carlos84, anaestrada12, steem-ua, utopian-io, tombstone, jga, cryptouno, swapsteem, sbi3, pennsif, steemstem, alexzicky, dna-replication, intellihandling, praditya, mohaaking, jeffjagoe, tuoficinavirtual, erikkun28, aalok, traviseric, emmanuel293, rhemakosi, alexworld, moniroy, kingnosa, huilco, pflanzenlilly, faberleggenda, coolbuddy, mattiarinaldoni, scoora82, casiloko, amin-ove, cameravisual, donasys, mtfmohammad, gpcx86, steemitbuzz, curie, locikll, wstanley226, chrisluke, vact, diebaasman, hotsteam, reaverza, pinksteam, trixie, hendrikdegrote, anwenbaumeister, lemouth, robotics101, effofex, kevinwong, sco, rharphelle, de-stem, temitayo-pelumi, kingabesh, alexander.alexis, cryptokrieg, yaelg, howo, lianaakobian, terrylovejoy, aboutyourbiz, kryzsec, deholt, samminator, fbslo, dexterdev, derbesserwisser, javier.dejuan, bloom, abigail-dantes, gra, kenadis, mathowl, alexdory, francostem, jrevilla, stem.witness, stemng, geopolis, sissyjill, lesmouths-travel, jent, morbyjohn, nitego, serylt, arconite, mountain.phil28, monie, croctopus, steemzeiger, biomimi, captainquenta, moksamol, neumannsalva, zonguin, corsica, enzor, drmake, whoib, the.chiomz, menoski, isacoin, blewitt, zest, mariusfebruary, lekang, peaceandwar, mahdiyari, lamouthe, eniolw, yestermorrow, morph, jagoe, wackou, jiujitsu, combatsports, meq, massivevibration, rival, benleemusic, drsensor, robertbira, yomismosoy, kafupraise, lk666, ivan-g, oghie, wargof, guga34, emrebeyler, yollardannotlar, delegate.lafona,