Omar ID EL MOUMEN commited on
Commit
4db63fb
·
1 Parent(s): 277a249

Fix title won't return new line

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. static/script.js +2 -2
app.py CHANGED
@@ -98,7 +98,7 @@ async def extract_text_pdf(document: DocumentID):
98
  return removed_parentheses
99
 
100
  def remove_punctuations(text):
101
- return re.sub(r"[\,\;\:\?\!\'\’\"\(\)\{\}\[\]\/\\\*\-]", '', text)
102
 
103
  postprocess_text = remove_in_betweens(pdf_text)
104
  postprocess_text = remove_punctuations(postprocess_text)
 
98
  return removed_parentheses
99
 
100
  def remove_punctuations(text):
101
+ return re.sub(r"[\,\;\:\?\!\'\’\"\(\)\{\}\[\]\/\\\*]", '', text)
102
 
103
  postprocess_text = remove_in_betweens(pdf_text)
104
  postprocess_text = remove_punctuations(postprocess_text)
static/script.js CHANGED
@@ -162,12 +162,12 @@ document.addEventListener('DOMContentLoaded', function() {
162
  return;
163
  }
164
  let t = "";
165
- if(typeof data.titles == Array){
166
  data.titles.forEach(title => {
167
  t += title + "<br>";
168
  });
169
  popupText.textContent = t;
170
- }else {
171
  popupText.textContent = data.titles;
172
  }
173
  } catch (error) {
 
162
  return;
163
  }
164
  let t = "";
165
+ if(data.titles.isArray()){
166
  data.titles.forEach(title => {
167
  t += title + "<br>";
168
  });
169
  popupText.textContent = t;
170
+ } else {
171
  popupText.textContent = data.titles;
172
  }
173
  } catch (error) {