Get the article title as an H1.

@return void
971267
function() {
    var doc = this._doc;
    var curTitle = "";
    var origTitle = "";

    try {
      curTitle = origTitle = doc.title;

      // If they had an element with id "title" in their HTML
      if (typeof curTitle !== "string")
        curTitle = origTitle = this._getInnerText(doc.getElementsByTagName('title')[0]);
    } catch (e) {/* ignore exceptions setting the title. */}

    var titleHadHierarchicalSeparators = false;
    function wordCount(str) {
      return str.split(/\s+/).length;
    }

    // If there's a separator in the title, first remove the final part
    if ((/ [\|\-\\\/>»] /).test(curTitle)) {
      titleHadHierarchicalSeparators = / [\\\/>»] /.test(curTitle);
      curTitle = origTitle.replace(/(.*)[\|\-\\\/>»] .*/gi, '$1');

      // If the resulting title is too short (3 words or fewer), remove
      // the first part instead:
      if (wordCount(curTitle) < 3)
        curTitle = origTitle.replace(/[^\|\-\\\/>»]*[\|\-\\\/>»](.*)/gi, '$1');
    } else if (curTitle.indexOf(': ') !== -1) {
      // Check if we have an heading containing this exact string, so we
      // could assume it's the full title.
      var headings = this._concatNodeLists(
        doc.getElementsByTagName('h1'),
        doc.getElementsByTagName('h2')
      );
      var match = this._someNode(headings, function(heading) {
        return heading.textContent === curTitle;
      });

      // If we don't, let's extract the title out of the original title string.
      if (!match) {
        curTitle = origTitle.substring(origTitle.lastIndexOf(':') + 1);

        // If the title is now too short, try the first colon instead:
        if (wordCount(curTitle) < 3) {
          curTitle = origTitle.substring(origTitle.indexOf(':') + 1);
          // But if we have too many words before the colon there's something weird
          // with the titles and the H tags so let's just use the original title instead
        } else if (wordCount(origTitle.substr(0, origTitle.indexOf(':'))) > 5) {
          curTitle = origTitle;
        }
      }
    } else if (curTitle.length > 150 || curTitle.length < 15) {
      var hOnes = doc.getElementsByTagName('h1');

      if (hOnes.length === 1)
        curTitle = this._getInnerText(hOnes[0]);
    }

    curTitle = curTitle.trim();
    // If we now have 4 words or fewer as our title, and either no
    // 'hierarchical' separators (\, /, > or ») were found in the original
    // title or we decreased the number of words by more than 1 word, use
    // the original title.
    var curTitleWordCount = wordCount(curTitle);
    if (curTitleWordCount <= 4 &&
        (!titleHadHierarchicalSeparators ||
         curTitleWordCount != wordCount(origTitle.replace(/[\|\-\\\/>»]+/g, "")) - 1)) {
      curTitle = origTitle;
    }

    return curTitle;
  }
1207861
public function getTitle()
    {
        $title = ($this->Title) ? $this->Title : sprintf('Delete %s %s', count($this->ids), $this->dataClass);
        
        if ($this->User) {
            return $title .= sprintf(' (Initiated by %s)', $this->User->getTitle());
        }

        return $title;
    }
927731
public function getTitle()
    {
        $title = $this->title;

        if (isset($this->title_suffix)) {
            $title = $title.$this->title_suffix;
        }

        if (isset($this->title_prefix)) {
            $title = $this->title_prefix.$title;
        }

        return $title;
    }
234845
def title_and_h1_good?
      return unless @page
      arr = []
      @page.css('h1').each { |node| arr << node.text }
      @page.css('title').size == 1 && arr.uniq.size == arr.size
    end
1240694
public function getTitle()
    {
        $title = parent::getTitle();
        if ($this->Config()->title_pattern) {
            $title = $this->Config()->title_pattern;
        }
        return $title;
    }
829325
public function getTitle()
    {
        $t = $this->dom->getElementsByTagName('title')->item(0);
        if ($t == null) {
            return null;
        } else {
            return $t->nodeValue;
        }
    }
813909
protected function getTitle()
	{
		$title = '';

		if ($this->hidden)
		{
			return $title;
		}

		// Get the label text from the XML element, defaulting to the element name.
		$title = $this->element['label'] ? (string) $this->element['label'] : (string) $this->element['name'];
		$title = $this->translateLabel ? $this->getText()->translate($title) : $title;

		return $title;
	}
1367980
public function getTitle(): string
    {
        $metadata = $this->getMetadata();

        if (isset($metadata['Title'])) {
            return is_array($metadata['Title']) ? $metadata['Title'][0] ?? '' : $metadata['Title'];
        }

        return parent::getTitle();
    }
1017115
public function getTitle()
    {
        $crawler = $this->getCrawler();

        $result = $crawler->filter('h1');
        if ($result->count()) {
            return $result->html();
        }
    }
159038
public function title()
    {
        if (isset($this->title)) {
            return $this->title;
        }

        try {
            $config = $this->dashboardConfig();

            if (isset($config['title'])) {
                $this->title = $this->translator()->translation($config['title']);

                return $this->title;
            }
        } catch (Exception $e) {
            $this->logger->error($e->getMessage());
        }

        $obj = $this->obj();
        $metadata = $obj->metadata();
        $objLabel = null;

        if (!$objLabel && isset($metadata['admin']['forms'])) {
            $adminMetadata = $metadata['admin'];

            $formIdent = filter_input(INPUT_GET, 'form_ident', FILTER_SANITIZE_STRING);
            if (!$formIdent) {
                $formIdent = (isset($adminMetadata['default_form']) ? $adminMetadata['default_form'] : '');
            }

            if (isset($adminMetadata['forms'][$formIdent]['label'])) {
                $objLabel = $this->translator()->translation($adminMetadata['forms'][$formIdent]['label']);
            }
        }

        if (!$objLabel) {
            $objType = (isset($metadata['labels']['singular_name']) ?
                $this->translator()->translation($metadata['labels']['singular_name']) : null);

            $objLabel = $this->translator()->translation('Documentation: {{ objType }}');

            if ($objType) {
                $objLabel = strtr($objLabel, [
                    '{{ objType }}' => $objType
                ]);
            }
        }

        if ($obj->view()) {
            $this->title = $obj->render((string)$objLabel, $obj);
        } else {
            $this->title = (string)$objLabel;
        }

        return $this->title;
    }
870200
protected function displayTitle()
    {
        if ($this->title !== null) {
            $header_tag = new SwatHtmlTag('h' . $this->getHeaderLevel());
            $header_tag->class = 'swat-frame-title';
            $header_tag->setContent($this->title, $this->title_content_type);

            if ($this->subtitle === null) {
                $header_tag->display();
            } else {
                $span_tag = new SwatHtmlTag('span');
                $span_tag->class = 'swat-frame-subtitle';
                $span_tag->setContent(
                    $this->subtitle,
                    $this->title_content_type
                );

                $header_tag->open();
                $header_tag->displayContent();
                echo $this->title_separator;
                $span_tag->display();
                $header_tag->close();
            }
        }
    }
181521
public function name() {
		if ( $title = $this->title() ) {
			return $title;
		}
		if ( isset($this->_name) ) {
			return $this->_name;
		}
		return '';
	}
810001
public function get_title() {
        $str = '';

        if (isset($this->refno_t)) {
            $str = $this->refno_t;

            if (isset($this->altrefno_t)) {
                $str .= ' / ' . $this->altrefno_t;
            }
        }

        return $str;
    }
346972
public function getAdminListTitle()
    {
        $prefix = '';
        $lvl    = $this->getLvl();
        for ($i = 0; $i < $lvl; $i++) {
            $prefix .= '&nbsp;&nbsp;&nbsp;&nbsp;';
        }

        return $prefix.$this->getTitle();
    }
667522
function title_true()
	{
		if(method_exists($this, 'title'))
			return $this->title();

		if(!empty($this->attr['title']))
			return $this->attr['title'];

		if(!empty($this->data['title']))
			return $this->data['title'];

		return NULL;
	}
543654
def title
      doc.at("//head/meta[@name='title']")["content"].split(/\(.*\)/)[0].strip! ||
          doc.at("h1.header").children.first.text.strip

    end
233708
public function getAdminTitleHtmlAttribute()
    {
        return __('decoy::changes.admin_title', [
            'admin' => $this->getAdminLinkAttribute(),
            'action' => $this->getActionLabelAttribute(),
            'model' => $this->getModelNameHtmlAttribute(),
            'model_title' => $this->getLinkedTitleAttribute(),
            'date' => $this->getDateAttribute()
        ]);
    }