Improving Django/VueJS/PostgreSQL by incorporating leading and trailing whitespace tabs

Currently, I am managing a text-field in Django through Django-admin which requires maintaining white-space integrity. To achieve this, I am encapsulating it within <pre> </pre> tags for rendering with the assistance of vueJS and vue-material.

Through this method, the white-space is correctly preserved, even when inspecting the descrip field of my model manually via the python manage.py shell confirming that the white-space exists in the database.

https://i.sstatic.net/SlKNY.png

Mysteriously, there seems to be an additional leading white-space tab at both the beginning and end of my HTML when rendered, as seen here:

https://i.sstatic.net/LCLLW.png

This extra space is also visible in the HTML snippet provided below:

https://i.sstatic.net/oOkLx.png

Here are the relevant sections of code:

relevant html and css

  <md-layout md-column md-flex-xsmall="100" md-flex-small="55"
     md-flex-medium="70" md-flex-large="80" id="summary_block">
    <md-layout >
      <pre class="md-body">
         [[ product.descrip ]]
      </pre>
    </md-layout>
  </md-layout>

#summary_block > div.md-layout > pre {
  white-space: pre-wrap; 
  word-wrap: break-word;
  font-family: inherit;
}

Is this possibly related to a postgres issue? If so, why does the white-space not appear when examining object.descrip in the python shell?

My tech stack includes postgres, vuejs, django version 1.10, python 3.5, and vue-material.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Trouble with jump link functionality within an ASP.NET iframe

On my asp.net page named Home.aspx, I have an iframe with the ID frame1. The iframe contains some HTML design with multiple headers. I am trying to search for the headers using quick links, but it seems to work fine on an HTML page, not on the asp.net page ...

Distributing the event object without the use of jQuery

Sorry for the basic question. It's been a challenge to find information on JS event handling without running into jQuery examples. I'm focused on DOM manipulation using pure Javascript to gain a deeper understanding of browser functionality. I w ...

What is the best way to incorporate several php files into a WordPress post?

I have developed a system that retrieves information from a database and presents it in multiple text files. Now, I am looking to move this system to a page on a WordPress website. I have already created a custom page named page-slug.php and added the ne ...

Generate visual representations of data sorted by category using AngularJS components

I am facing an unusual issue with Highcharts and Angularjs 1.6 integration. I have implemented components to display graphs based on the chart type. Below is an example of the JSON data structure: "Widgets":[ { "Id":1, "description":"Tes ...

Passing data between Vue.js components effortlessly without relying on events

At the moment, I am utilizing Laravel Nova. It's worth noting that it operates using vue.js. I've created a personalized vue component which requires the ability to modify data inside another component. This specific component is located in the ...

What is the reason behind getComputedStyle having visibility set to visible?

What is the reason behind getComputedStyle always returning element visibility as visible even when no explicit visibility has been set? For instance: getComputedStyle($('#block1')[0],null).visibility; --- "visible" Meanwhile: $('#block1&a ...

Django just threw a fit, saying 'Cannot assign "u'Wing'": "Truck.MODEL" must be a "MODEL" instance' while trying to add a new object to the database

Database Models: class MODEL(models.Model): ModelName = models.CharField(max_length = 128, unique = True) URL_Slug = models.SlugField(unique = True) ... class Maker(models.Model): maker = models.CharField(max_length = 128, unique = True) ...

Autonomous boundary for list elements

I have a specific issue that can be observed in this fiddle: http://jsfiddle.net/h0qu4ffv/ where I set the margin-top of one list item to 50px, but all list items end up following this style. Is there a way to give each list item an independent margin, or ...

Run a function continuously while a key is being held down

I am currently working on a Javascript program that will move a div up and down based on key inputs. The idea is to continuously update the 'top' style value of the div while a specific key is pressed. While the basic function works, I am struggl ...

When attempting to upload an API object, the error message '"'Image' object is not callable"' is displayed

Update 2, 13th Jan: Following a thorough bug search and attempting to post the object directly in the root API using json, I've concluded that the issue causing the posting error is related to the image. I utilized the HTML form to post an object, re ...

Issue with Django and Bootstrap: form-check-inline functionality not functioning as expected

UPDATE 1 I have attempted to use both crispy-forms and widget-tweaks, but it does not seem to work. It appears that widget=forms.RadioSelect() is not compatible with using these two libraries together... I am looking to display radio buttons inline usin ...

Using Mat-Error for Two Way Binding leads to frequent triggering of ngModelChange事件

I am working with a mat input field that has two-way data binding using ngModel, and I want to add validation using mat-error and formControl. <mat-form-field [formGroup]="myForm"> <input matInput formControlName="myFormName" autocomplete="off" ...

What is the process for navigating back to the previous page in Django after completing a task?

Upon completing the creation of a moneylog, I wish to return to the moneybook_detail page. To achieve this, I have implemented the following code in my moneylog/View.py: class moneylog_create(FormView): form_class = forms.CreateMoneylogForm templ ...

Broadcasting Notifications in Laravel 5.4

I have successfully set up the database and ensured that all data is being inserted correctly. I am using Laravel Echo to listen for notifications, which are then being recorded on Pusher. However, I am facing an issue where my notifications are not being ...

Tips for ensuring the footer always stays at the bottom of the page

I'm having an issue with keeping the footer pinned to the bottom of the page. I haven't applied any specific styles to the footer, just placed it at the end of the content. Everything looks great until there's a page with minimal content, ca ...

An element in CSS that has a position of fixed and a width of 100% surpasses the dimensions of its

My element has the CSS properties position:fixed and width:100%, causing it to be larger than its parent elements. Despite the complexity of my code, I have attempted to simplify it for better understanding. Below, you can see that the green box exceeds ...

Ways to enable smooth scrolling feature in Safari

I attempted to implement smoothscroll using a polyfill by adding the following code to the bottom of my body tag: <script src="https://unpkg.com/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e99a8486869d819a8a9b868585c ...

Ensuring complete height and width with no scrollbar in a Material UI React application

I'm attempting to create a page that fills the entire height of the screen without adding an undesirable scrollbar. When I say 100% height, I mean it should just fit the size of the screen. Here is a demonstration of the issue. The yellow highlighted ...

The cart icon is not visible in the responsive mode

There seems to be an issue with my cart icon not displaying in the navbar toggle when the display size is reduced. I am currently using Bootstrap 5 for the navbar. I can navigate to the cart page by clicking on the toggler, but the icon itself is not visi ...

Creating users with varying levels of access using a Django form

In the Django system I'm currently developing, I've implemented four levels of users: 1. Basic (limited access) 2. Admin (full access for updates/changes/deletes) 3. Gatekeeper (can only create Admin users, no other permissions) 4. Developer (ful ...