Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion textutils/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def analyze(request):
newlineremover = request.POST.get('newlineremover', 'off')
extraspaceremover = request.POST.get('extraspaceremover', 'off')
numberremover = request.POST.get('numberremover','off')
charcount = request.POST.get('charcount', 'off')

#Check which checkbox is on
if removepunc == "on":
Expand Down Expand Up @@ -69,6 +70,11 @@ def analyze(request):

params = {'purpose': 'Removed NewLines', 'analyzed_text': analyzed}
djtext = analyzed
if charcount == "on":
chrcount = ""
chrcount = len(djtext)
params = {'purpose': 'Character Count', 'analyzed_text': analyzed,
'chrcount': f'Total Number of characters are {chrcount}'}


if(removepunc != "on" and newlineremover!="on" and extraspaceremover!="on" and fullcaps!="on" and numberremover != "on"):
Expand All @@ -77,4 +83,4 @@ def analyze(request):
return render(request, 'analyze.html', params)

def about(request):
return render(request, 'about.html')
return render(request, 'about.html')