Omar ID EL MOUMEN commited on
Commit
ad1e294
·
1 Parent(s): bceef6c

Mini-patch #3

Browse files
Files changed (2) hide show
  1. app.py +1 -0
  2. static/script.js +8 -2
app.py CHANGED
@@ -109,6 +109,7 @@ async def extract_text_pdf(document: DocumentID):
109
  main_titles = []
110
  if len(titles) <= 0:
111
  main_titles = re.findall(regex_titles, postprocess_text, flags=re.MULTILINE)
 
112
  else:
113
  for title in titles:
114
  if title[0] == 1 or title[0] == 2:
 
109
  main_titles = []
110
  if len(titles) <= 0:
111
  main_titles = re.findall(regex_titles, postprocess_text, flags=re.MULTILINE)
112
+ main_titles = [(-1, t) for t in main_titles]
113
  else:
114
  for title in titles:
115
  if title[0] == 1 or title[0] == 2:
static/script.js CHANGED
@@ -163,8 +163,14 @@ document.addEventListener('DOMContentLoaded', function() {
163
  }
164
  let t = "";
165
  if(Array.isArray(data.titles)){
166
- data.titles.forEach(title => {
167
- t += title + "<br><br>";
 
 
 
 
 
 
168
  });
169
  popupText.innerHTML = t;
170
  } else {
 
163
  }
164
  let t = "";
165
  if(Array.isArray(data.titles)){
166
+ data.titles.forEach((index, title) => {
167
+ if(index == 1){
168
+ t += title + "<br>"
169
+ } else if (index == 2) {
170
+ t += "<pre>" + title + "<br></pre>"
171
+ } else {
172
+ t += title + "<br>"
173
+ }
174
  });
175
  popupText.innerHTML = t;
176
  } else {