Comments (5)
I would be sure to have an English explanation of how to limit is computed. Not just code samples.
The code sample was intended for people implementing this improved documentation, not for the users.
from pretalx.
First off,
But Jimmy's is barred because he took the time to learn HTML and now he pays the price.
That's a pretty antagonistic way to start off a feature request, and I don't really have the patience to respond in a kind and educational manner today, so I'm going to leave it at that.
OR, state explicitly before the user starts entering text, that you will be counting formatting too in your counts, so if the users uses HTML then he should be prepared to pay the price.
That's a fairly technical piece of information, and while pretalx is used for many tech events, it's also used for many non-tech events where users are barely aware of how to write Markdown / HTML in the first place. However, organisers can add a hint like this when they configure their event, and for technical events with strict word limits (not a typical use case!), that may be the best approach to take here.
(Markdown too?)
As the text isn't converted in any way before counting words, yes, Markdown is counted too – though by the nature of Markdown, I'd expect it to be much closer to what you'd expect in terms of word count – in your example, the HTML is counted as 140 words and the Markdown as 126 words.
We already link to our documentation to explain how Markdown works. We could have an equivalent page that explains how length restrictions work, including a small JavaScript tester / calculator for word counts. I'd merge a contribution like that – the relevant code is as follows:
const wordCount = (str) => {const re = /\b\w+\b/g; return ((str||'').match(re) || []).length }
from pretalx.
Well all I know is I had to submit the form any times until I could get it down to the limits.
There wasn't even a way to test it per field. The whole form had to be submitted to find the results.
I would be sure to have an English explanation of how to limit is computed. Not just code samples.
from pretalx.
Seems \w
isn't always the best choice,
$ echo "Bill's dog."|perl -nwle '$k++ for /\w+/g; END{print $k}'
3
$ echo "Bill's dog."|wc -w
2
https://github.com/pretalx/pretalx/blob/main/src/pretalx/common/forms/utils.py is where the counting takes place.
https://www.google.com/search?q=counting+words+in+django maybe has better ideas.
$ perl -nwle '$k++ for /\w+/g; END{print $k}' file.txt
845
$ perl -nwle '$k++ for /\S+/g; END{print $k}' file.txt
823
$ wc --words file.txt
823 file.txt
from pretalx.
Linking to Google results is neither productive nor appropriate. Locking this conversation.
from pretalx.
Related Issues (20)
- Heroku/Dokku deployment compatibility HOT 1
- Markdown headers get bigger at header level 4 HOT 3
- Link to question reminder email form in question reminder sending page
- Remove pretalx.common.models.Choices HOT 6
- Update site title in proposal wizard to include current proposal name HOT 4
- Ability to share received feedback HOT 2
- Proposal counts for speakers incorrect when showing Speakers only
- Answers to per-speaker (and per-submission) questions not included in API output HOT 2
- "Send mail to speakers" link is wrong HOT 1
- pretalx-schedule widget: settings bar stretches width of content causing horizontal scrollbar HOT 1
- Locale only partially applied, mostly English fallback loaded HOT 4
- CSRF issue when adding an image to speaker HOT 4
- Ability to automate submitting talks HOT 1
- Event clone: breaks reviewer teams / track assignments
- Download only the Starred Appointments HOT 1
- CSS-Files from Media get blocked due to MIME type
- CSS-Media-Files get blocked due to MIME type HOT 2
- Anonymisation UI is out of the viewport on Firefox and Chrome
- Markdown only partially rendered in Session list entry HOT 1
- Calendar export ignores filters HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pretalx.